Method |
Description |
|
assert ( boolean $expression, string | boolean $message = false, array $data = [] ) : boolean |
General assert method used by others for common output. |
|
assertArrayHasKey ( $key, array $array, string | boolean $message = '{:message}' ) : boolean |
Assert that the result array has given key. |
|
assertArrayNotHasKey ( $key, array $array, string | boolean $message = '{:message}' ) : boolean |
Assert that the result array does *not* have given key. |
|
assertClassHasAttribute ( mixed $attributeName, string $class, string | boolean $message = '{:message}' ) : boolean |
Assert that a class has a given attribute. |
|
assertClassHasStaticAttribute ( mixed $attributeName, string $class, string | boolean $message = '{:message}' ) : boolean |
Assert that a class does have a given _static_ attribute. |
|
assertClassNotHasAttribute ( mixed $attributeName, string $class, string | boolean $message = '{:message}' ) : boolean |
Assert that a class does *not* have a given attribute. |
|
assertClassNotHasStaticAttribute ( $attrName, string $class, string | boolean $message = '{:message}' ) : boolean |
Assert that a class does *not* have a given _static_ attribute. |
|
assertContains ( string $needle, mixed $haystack, string | boolean $message = '{:message}' ) : boolean |
Assert that $haystack contains $needle as a value. |
|
assertContainsOnly ( string $type, array | object $haystack, string | boolean $message = '{:message}' ) : boolean |
Assert that $haystack does only contain item of given type. |
|
assertContainsOnlyInstancesOf ( string $class, array | object $haystack, string | boolean $message = '{:message}' ) : boolean |
Assert that $haystack contains only instances of given class. |
|
assertCookie ( array $expected, array $headers = null ) : boolean |
Assert Cookie data is properly set in headers. |
|
assertCount ( integer $expected, array $array, string | boolean $message = '{:message}' ) : boolean |
Assert that the passed result array has expected number of elements. |
|
assertEmpty ( string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that given result is empty. |
|
assertEqual ( mixed $expected, mixed $result, string | boolean $message = '{:message}' ) : boolean |
Assert that the actual result is equal, but not neccessarily identical, to the expected
result. |
|
assertException ( mixed $expected, Closure $closure, string $message = '{:message}' ) : boolean |
Assert that the code passed in a closure throws an exception or raises a PHP error. The
first argument to this method specifies which class name or message the exception must
have in order to make the assertion successful. |
|
assertFalse ( mixed $result, string $message = '{:message}' ) : boolean |
Assert that the result strictly is false. |
|
assertFileEquals ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that the file contents of $expected are equal to the contents of $actual. |
|
assertFileExists ( string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that a file exists. |
|
assertFileNotEquals ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that the file contents of $expected are *not* equal to the contents of $actual. |
|
assertFileNotExists ( string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that a file does *not* exist. |
|
assertGreaterThan ( float | integer $expected, float | integer $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $expected is greater than $actual. |
|
assertGreaterThanOrEqual ( float | integer $expected, float | integer $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $expected is greater than or equal to $actual. |
|
assertIdentical ( mixed $expected, mixed $result, string | boolean $message = '{:message}' ) : boolean |
Assert that the actual result and the expected result are identical using a strict
comparison. |
|
assertInstanceOf ( string $expected, object $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $actual is an instance of $expected. |
|
assertInternalType ( string $expected, object $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $actual is of given type. |
|
assertLessThan ( float | integer $expected, float | integer $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $expected is less than $actual. |
|
assertLessThanOrEqual ( float | integer $expected, float | integer $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $expected is less than or equal to $actual. |
|
assertNoCookie ( array $expected, array $headers = null ) : boolean |
Assert Cookie data is *not* set in headers. |
|
assertNotContains ( string $needle, miexed $haystack, string | boolean $message = '{:message}' ) : boolean |
Assert that $haystack does *not* contain $needle as a value. |
|
assertNotContainsOnly ( string $type, array | object $haystack, string | boolean $message = '{:message}' ) : boolean |
Assert that $haystack hasn't any items of given type. |
|
assertNotCount ( integer $expected, array $array, string | boolean $message = '{:message}' ) : boolean |
Assert that the passed result array has *not* the expected number of elements. |
|
assertNotEmpty ( string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that given result is *not* empty. |
|
assertNotEqual ( mixed $expected, mixed $result, string | boolean $message = '{:message}' ) : boolean |
Assert that the actual result and the expected result are *not* equal to each other. |
|
assertNotException ( mixed $expected, Closure $closure, string $message = '{:message}' ) : boolean |
Assert that the code passed in a closure does not throw an exception matching the passed
expected exception. |
|
assertNotIdentical ( mixed $expected, mixed $result, string | boolean $message = '{:message}' ) : boolean |
Assert that the actual result and the expected result are *not* identical using a strict
comparison. |
|
assertNotInstanceOf ( string $expected, object $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $actual is *not* an instance of $expected. |
|
assertNotInternalType ( string $expected, object $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that $actual is *not* of given type. |
|
assertNotNull ( $actual, string $message = '{:message}' ) : boolean |
Assert that the result is *not* strictly null. |
|
assertNotPattern ( mixed $expected, mixed $result, string $message = '{:message}' ) : boolean |
Assert that the regular expression $expected is *not* matched in the result. |
|
assertNull ( mixed $result, string $message = '{:message}' ) : boolean |
Assert that the result is strictly null. |
|
assertObjectHasAttribute ( string $attributeName, string $object, string | boolean $message = '{:message}' ) : boolean |
Assert that $object has given attribute. |
|
assertObjectNotHasAttribute ( string $attributeName, string $object, string | boolean $message = '{:message}' ) : boolean |
Assert that $object does *not* have given attribute. |
|
assertPattern ( mixed $expected, mixed $result, string $message = '{:message}' ) : boolean |
Assert that the regular expression $expected is matched in the result. |
|
assertStringEndsWith ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert given result string has given suffix. |
|
assertStringMatchesFormat ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that given value matches the sprintf format. |
|
assertStringNotMatchesFormat ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert that given value does *not* matche the sprintf format. |
|
assertStringStartsWith ( string $expected, string $actual, string | boolean $message = '{:message}' ) : boolean |
Assert given result string has given prefix. |
|
assertTags ( string $string, array $expected ) : boolean |
Takes an array $expected and generates a regex from it to match the provided $string. |
|
assertTrue ( mixed $result, string $message = '{:message}' ) : boolean |
Assert that the result is strictly true. |
|
expectException ( mixed $message = true ) : void |
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. |
|
fail ( string $message = false ) |
Generates a failed test with the given message. |
|
get ( string $class ) : string |
Finds the test case for the corresponding class name. |
|
methods ( ) : array |
Return test methods to run. |
|
results ( ) : array |
Returns the current results. |
|
run ( array $options = [] ) : array |
Runs the test methods in this test case, with the given options. |
|
setUp ( ) : void |
Setup method run before every test method. Override in subclasses. |
|
skip ( ) |
Subclasses should use this method to set conditions that, if failed, terminate further
testing. |
|
skipIf ( boolean $condition, string | boolean $message = false ) : mixed |
Skips test(s) if the condition is met. |
|
subject ( ) : string |
Returns the class name that is the subject under test for this test case. |
|
tearDown ( ) : void |
Teardown method run after every test method. Override in subclasses. |
|