SapphireTestReporter
class SapphireTestReporter implements PHPUnit_Framework_TestListener (View source)
Gathers details about PHPUnit2 test suites as they are been executed. This does not actually format any output but simply gathers extended information about the overall results of all suites & their tests for use elsewhere.
Changelog: 0.6 First created [David Spurr] 0.7 Added fix to getTestException provided [Glen Ogilvie]
Methods
Constructor, checks to see availability of PEAR Benchmark_Timer and sets up basic properties
Returns the suite results
Sets up the container for result details of the current test suite when each suite is first run
Sets up the container for result details of the current test when each test is first run
Adds the failure detail to the current test and increases the failure count for the current suite
Adds the test incomplete detail to the current test and increases the incomplete count for the current suite
Upon completion of a test, records the execution time (if available) and adds the test to the tests performed in the current suite.
Upon completion of a test suite adds the suite to the suties performed
Display error bar if it exists
Details
void
__construct()
Constructor, checks to see availability of PEAR Benchmark_Timer and sets up basic properties
array
getSuiteResults()
Returns the suite results
void
startTestSuite(PHPUnit_Framework_TestSuite $suite)
Sets up the container for result details of the current test suite when each suite is first run
void
startTest(PHPUnit_Framework_Test $test)
Sets up the container for result details of the current test when each test is first run
void
addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
Adds the failure detail to the current test and increases the failure count for the current suite
void
addError(PHPUnit_Framework_Test $test, Exception $e, $time)
Adds the error detail to the current test and increases the error count for the current suite
void
addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)
Adds the test incomplete detail to the current test and increases the incomplete count for the current suite
addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, unknown_type $time)
Not used
void
endTest(PHPUnit_Framework_Test $test, $time)
Upon completion of a test, records the execution time (if available) and adds the test to the tests performed in the current suite.
void
endTestSuite(PHPUnit_Framework_TestSuite $suite)
Upon completion of a test suite adds the suite to the suties performed
addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, float $time)
Risky test.
writeResults()
Display error bar if it exists