PHP Errors: Setter Helper
- And a helper that...
- Stores the expected error for later examination
- Adds your handler to PHP's error handler stack
abstract class TestCase extends PHPUnit_Framework_TestCase {
protected function expected_errors($error_messages) {
$this->expected_error_list = (array) $error_messages;
set_error_handler(array(&$this, 'expected_errors_handler'));
}
}