PHPUnit_TestCase

PHPUnit_TestCase --  Base class for creating a test suite class

Using

Normally you did not use this class directly. For creating a test case you write a class inheriting from PHPUnit_TestCase and maybe have to overwrite setUp() and tearDown(). Then you add the test functions to the class.

PHPUnit_TestCase::PHPUnit_TestCase

void PHPUnit_TestCase::PHPUnit_TestCase ([string $name = false])

Creates a test case with the given name

Parameter

PHPUnit_TestCase::setUp

void PHPUnit_TestCase::setUp ()

This function is called before the test functions will be executed.

PHPUnit_TestCase::tearDown

void PHPUnit_TestCase::tearDown ()

This function is called after the test functions are executed.

PHPUnit_TestCase::test*

void PHPUnit_TestCase::test* ()

Every function in your test class beginning with test is handled as a test function of your test class. In this functions, you have to call your function or create a situation to test. Make sure that every function calls a member of the assert*()-family.

Example

function testMe() {
     $expected = ...
     $result = ...
     $this->assertTrue($expected == $result);
}