lithium\test\Unit::expectException()
Used before a call to assert*()
if you expect the test assertion to generate an exception
or PHP error. If no error or exception is thrown, a test failure will be reported. Can
be called multiple times per assertion, if more than one error is expected.
Parameters
-
mixed
$message
A string indicating what the error text is expected to be. This can be an exact string, a /-delimited regular expression, or true, indicating that any error text is acceptable.
Returns
voidSource
public function expectException($message = true) {
$message = "Unit::expectException() is deprecated in favor of Unit::assertException().";
trigger_error($message, E_USER_DEPRECATED);
$this->_expected[] = $message;
}