Abstract Class Test\Unit\Assertions

Methods

Protected instance methods

assert($test, $message='')

assert_block($message, $block)

Base assertion that is used by all other assertions. Passed block must return a boolean: true if assertion is succesful, false otherwise.

assert_equal($test, $expected, $message='')

assert_false($test, $message='')

assert_instance_of($object, $class_name, $message='')

assert_match($pattern, $text, $message='')

assert_no_match($pattern, $text, $message='')

assert_not_equal($test, $expected, $message='')

assert_not_null($test, $message='')

assert_nothing_thrown()

assert_nothing_thrown(function() { // code that won't throw any exception }, "some message");

assert_null($test, $message='')

assert_throws()

assert_throws('TestException' 'OtherTestException', function() { throw new TestException('test'); }, "some message");

assert_true($test, $message='')

Alias for assert.

assert_type($var, $type, $message='')

build_message($head, $template=null)

flunk($message='')