This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Assertion Reference
In all examples, [$msg] is optional, and if provided will be displayed on a failed test.
Basic Single-Part Assertions
| methodName($params, [$optional]) | Description |
|---|---|
| assertTrue($value, [$msg]) | Tests if $value evaluates to true. This is a strict type comparison, so only a boolean true will pass. |
| assertFalse($value, [$msg]) | Tests if $value evaluates to false. This is a strict type comparison, so only a boolean false will pass. |
| assertNull($value, [$msg]) | Tests if $value is evaluates to null. This is a strict type comparison, so only true null will pass. |
| assertNotNull($value, [$msg]) | Tests if $value evaluates to anything but null. This is a strict type comparison, so anything but null will pass. |
Basic Two-Part Assertions
| methodName($params, [$optional]) | Description |
|---|---|
| assertEqual($expected, $actual, [$msg]) | Tests that $expected equals $actual, using a loose type (==) comparison. |
| assertNotEqual($expected, $actual, [$msg]) | Tests that $expected does not equal $actual, using a loose type (!=) comparison. |
| assertIdentical($expected, $actual, [$msg]) | Tests that $expected is identical to $actual, using a strict type (===) comparison. |
| assertNotIdentical($expected, $actual, [$msg]) | Tests that $expected is not identical to $actual, using a strict type (!==) comparison. |
Complex Assertions
| methodName($params, [$optional]) | Description |
|---|---|
| assertIsA($object, $classname, [$msg]) | Tests that $object is of type $classname. $classname can be an object, or the string of the class name for comparison. This assertion will also pass for inheritance or a test for an interface. |
| assertRegex($value, $regex, [$msg]) | Tests that $value passes the regular expression $regex. |
Call Count Assertions
Call count assertions depend on a mock object to perform a check. Mock objects can be created with a call to $this→mock(). See the section on MockObjects for information on creating valid testable objects for these assertions.
In these calls, $params is an optional argument. If provided, calls will be matched against the parameter expectations passed in.
Some examples of the assertCallCount call
</code> $this->assertCallCount($mocked_class, 'fooMethod', 3, array(new Snap_Anything_Expectation())) $this->assertCallCount($mocked_class, 'fooMethod', 7);
| *methodName($params, [$optional]) | Description |
| assertCallCount($object, $method, $expected, [$params], [$msg]) | Tests that $object→$method has been called $expected times. |
| assertMinimumCallCount($object, $method, $expected, $params, [$msg]) | Tests that $object→$method has been called at least an $expected number of times. |
| assertMaximumCallCount($object, $method, $expected, $params, [$msg]) | Tests that $object→$method has not been called more than $expected number of times. |







