Class TipyTestCase
Tipy Test Framework
TipyTestUnit is the implementation of the xUnit test framework
class SimpleTest extends TipyTestCase { public function testExample() { $this->assertEqual(1, true); } }
Conventions
- Tests and fixtures live in tests directory
- Fixtures are plain .sql files
- Test case file names end with Test (like MyTest.php)
- Test case file contains one class
- Test case is a class extending
TipyTestCase - Test case class have the same name as the file containing it
- Tests are public methods starting with test (like testExample)
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
assertEqual( mixed $actual, mixed $expected )
Report an error if $actual and $expected are not equal |
public
|
#
assertNotEqual( mixed $actual, mixed $expected )
Report an error if $actual and $expected are equal |
public
|
#
assertIdentical( mixed $actual, mixed $expected )
Report an error if $actual and $expected are not identical |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
assertThrown( string $exceptionClass, string $exceptionMessage, closure $closure )
Report an error if $closure does not throw $exceptionClass with $exceptionMessage |
public
|
#
assertThrownRegexp( string $expectedClassString, regexp $expectedMessageRegexp, closure $closure )
Report an error if $closure does not throw $exceptionClass or $exceptionMessage does not match $expectedMessageRegexp |
public
array
|
public
boolean
|
$transactionalFixtures
Set this to false to turn off transactional fixtures |
#
true
|