Property | Type | Description | |
---|---|---|---|
$reportLength | integer | Number of tests to report on for slowness. | |
$slow | array | Collection of slow tests. | |
$slowThreshold | integer | Time in milliseconds at which a test will be considered "slow" and be reported by this listener. | |
$suites | integer | Increments as more suites are run, then decremented as they finish. All suites have been run when returns to 0. |
Method | Description | |
---|---|---|
__construct ( array $options = [] ) | Construct a new instance. | |
addError ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | An error occurred. | |
addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time ) | A failure occurred. | |
addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | Incomplete test. | |
addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | Risky test. | |
addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | Skipped test. | |
endTest ( PHPUnit_Framework_Test $test, float $time ) | A test ended. | |
endTestSuite ( PHPUnit_Framework_TestSuite $suite ) | A test suite ended. | |
startTest ( PHPUnit_Framework_Test $test ) | A test started. | |
startTestSuite ( PHPUnit_Framework_TestSuite $suite ) | A test suite started. |
Method | Description | |
---|---|---|
addSlowTest ( PHPUnit_Framework_TestCase $test, integer $time ) | Stores a test as slow. | |
getHiddenCount ( ) : integer | Find how many slow tests occurred that won't be shown due to list length. | |
getReportLength ( ) : integer | Calculate number of slow tests to report about. | |
getSlowThreshold ( PHPUnit_Framework_TestCase $test ) : integer | Get slow test threshold for given test. A TestCase can override the suite-wide slow threshold by using the annotation @slowThreshold with the threshold value in milliseconds. | |
hasSlowTests ( ) : boolean | Whether at least one test has been considered slow. | |
isSlow ( integer $time, integer $slowThreshold ) : boolean | Whether the given test execution time is considered slow. | |
loadOptions ( array $options ) | Populate options into class internals. | |
makeLabel ( PHPUnit_Framework_TestCase $test ) : string | Label for describing a test. | |
renderBody ( ) | Renders slow test report body. | |
renderFooter ( ) | Renders slow test report footer. | |
renderHeader ( ) | Renders slow test report header. | |
toMilliseconds ( float $time ) : integer | Convert PHPUnit's reported test time (microseconds) to milliseconds. |
public __construct ( array $options = [] ) | ||
$options | array |
public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time ) | ||
$test | PHPUnit_Framework_Test | |
$e | PHPUnit_Framework_AssertionFailedError | |
$time | float |
public addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | ||
$test | PHPUnit_Framework_Test | |
$e | Exception | |
$time | float |
public addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | ||
$test | PHPUnit_Framework_Test | |
$e | Exception | |
$time | float |
public addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) | ||
$test | PHPUnit_Framework_Test | |
$e | Exception | |
$time | float |
protected addSlowTest ( PHPUnit_Framework_TestCase $test, integer $time ) | ||
$test | PHPUnit_Framework_TestCase | |
$time | integer | Test execution time in milliseconds |
public endTestSuite ( PHPUnit_Framework_TestSuite $suite ) | ||
$suite | PHPUnit_Framework_TestSuite |
protected getHiddenCount ( ) : integer | ||
return | integer | Number of hidden slow tests |
protected getReportLength ( ) : integer | ||
return | integer |
\@slowThreshold 5000
public function testLongRunningProcess() }
protected getSlowThreshold ( PHPUnit_Framework_TestCase $test ) : integer | ||
$test | PHPUnit_Framework_TestCase | |
return | integer |
protected hasSlowTests ( ) : boolean | ||
return | boolean |
protected loadOptions ( array $options ) | ||
$options | array |
public startTest ( PHPUnit_Framework_Test $test ) | ||
$test | PHPUnit_Framework_Test |
public startTestSuite ( PHPUnit_Framework_TestSuite $suite ) | ||
$suite | PHPUnit_Framework_TestSuite |
protected toMilliseconds ( float $time ) : integer | ||
$time | float | |
return | integer |
protected int $reportLength | ||
return | integer |
protected int $slowThreshold | ||
return | integer |
protected int $suites | ||
return | integer |