PHPUnit_TestResult

PHPUnit_TestResult --  Analysing the result of a test run

Using

If you check the PHPUnit::run() documentation, you will note, that the function did not return true or false to return the success of a test suite.

Instead a PHPUnit_TestResult is returned. It contains information about the test suite run. To access this information, the PHPUnit_TestResult object provides a set of functions to process this information.

PHPUnit_TestResult::errorCount

integer PHPUnit_TestResult::errorCount ()

Return the number occured errors while running the test suite

Returns

PHPUnit_TestResult::&errors

array PHPUnit_TestResult::&errors ()

Returns a enumeration of the errors

Returns

PHPUnit_TestResult::failureCount

integer PHPUnit_TestResult::failureCount ()

Return the number occured failures while running the test suite

Returns

PHPUnit_TestResult::&failures

array PHPUnit_TestResult::&failures ()

Returns a enumeration of the failures

Returns

PHPUnit_TestResult::runCount

integer PHPUnit_TestResult::runCount ()

Returns the number of the test runs (number of tested functions)

Returns

PHPUnit_TestResult::toString

string PHPUnit_TestResult::toString ()

Returns a formatted plain text, reporting the test result

Returns

See

PHPUnit_TestResult::toHTML

string PHPUnit_TestResult::toHTML ()

Returns a careful formatted HTML text, reporting the test result, which can be directly passed to an HTML-Viewer

Returns

See