diff options
Diffstat (limited to 'tests/test_framework/phpbb_test_case.php')
| -rw-r--r-- | tests/test_framework/phpbb_test_case.php | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php index 3cf2a9d442..af867b29ff 100644 --- a/tests/test_framework/phpbb_test_case.php +++ b/tests/test_framework/phpbb_test_case.php @@ -9,29 +9,19 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase { - protected $expectedTriggerError = false; + protected $test_case_helpers; - public function setExpectedTriggerError($errno, $message = '') + public function init_test_case_helpers() { - $exceptionName = ''; - switch ($errno) + if (!$this->test_case_helpers) { - case E_NOTICE: - case E_STRICT: - PHPUnit_Framework_Error_Notice::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Notice'; - break; - - case E_WARNING: - PHPUnit_Framework_Error_Warning::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Warning'; - break; - - default: - $exceptionName = 'PHPUnit_Framework_Error'; - break; + $this->test_case_helpers = new phpbb_test_case_helpers($this); } - $this->expectedTriggerError = true; - $this->setExpectedException($exceptionName, (string) $message, $errno); + } + + public function setExpectedTriggerError($errno, $message = '') + { + $this->init_test_case_helpers(); + $this->test_case_helpers->setExpectedTriggerError($errno, $message); } } |
