diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2010-03-10 20:12:10 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2010-03-10 20:12:10 +0100 |
| commit | 3dd9040cc1396f2684a69272404467ebc44f9b58 (patch) | |
| tree | 6fcf568bec80551ea6d0668aa1695c723ce4f104 /tests/test_framework/phpbb_test_case.php | |
| parent | db8c557e4c6fee0a66c78863d4082dc17ff22d57 (diff) | |
| parent | 60bd1edcb5e5992e6e693d0f68db47e678f7d54a (diff) | |
| download | forums-3dd9040cc1396f2684a69272404467ebc44f9b58.tar forums-3dd9040cc1396f2684a69272404467ebc44f9b58.tar.gz forums-3dd9040cc1396f2684a69272404467ebc44f9b58.tar.bz2 forums-3dd9040cc1396f2684a69272404467ebc44f9b58.tar.xz forums-3dd9040cc1396f2684a69272404467ebc44f9b58.zip | |
Merge branch 'develop-olympus' into git-tools
Diffstat (limited to 'tests/test_framework/phpbb_test_case.php')
| -rw-r--r-- | tests/test_framework/phpbb_test_case.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php new file mode 100644 index 0000000000..3cf2a9d442 --- /dev/null +++ b/tests/test_framework/phpbb_test_case.php @@ -0,0 +1,37 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2008 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +class phpbb_test_case extends PHPUnit_Framework_TestCase +{ + protected $expectedTriggerError = false; + + public function setExpectedTriggerError($errno, $message = '') + { + $exceptionName = ''; + switch ($errno) + { + 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->expectedTriggerError = true; + $this->setExpectedException($exceptionName, (string) $message, $errno); + } +} |
