[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/tests/phpunit/includes/ -> speed-trap-listener.php (summary)

(no description)

File Size: 326 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

SpeedTrapListener:: (23 methods):
  __construct()
  addError()
  addWarning()
  addFailure()
  addIncompleteTest()
  addRiskyTest()
  addSkippedTest()
  startTest()
  endTest()
  startTestSuite()
  endTestSuite()
  isSlow()
  addSlowTest()
  hasSlowTests()
  toMilliseconds()
  makeLabel()
  getReportLength()
  getHiddenCount()
  renderHeader()
  renderBody()
  renderFooter()
  loadOptions()
  getSlowThreshold()


Class: SpeedTrapListener  - X-Ref

A PHPUnit TestListener that exposes your slowest running tests by outputting
results directly to the console.

__construct(array $options = array()   X-Ref
Construct a new instance.

param: array $options

addError(PHPUnit_Framework_Test $test, Exception $e, $time)   X-Ref
An error occurred.

param: PHPUnit_Framework_Test $test
param: Exception              $e
param: float                   $time

addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time)   X-Ref
A warning occurred.

param: PHPUnit_Framework_Test    $test
param: PHPUnit_Framework_Warning $e
param: float                     $time
since: Method available since Release 5.1.0

addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)   X-Ref
A failure occurred.

param: PHPUnit_Framework_Test                 $test
param: PHPUnit_Framework_AssertionFailedError $e
param: float                                   $time

addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)   X-Ref
Incomplete test.

param: PHPUnit_Framework_Test $test
param: Exception              $e
param: float                   $time

addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time)   X-Ref
Risky test.

param: PHPUnit_Framework_Test $test
param: Exception              $e
param: float                   $time
since: Method available since Release 4.0.0

addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)   X-Ref
Skipped test.

param: PHPUnit_Framework_Test $test
param: Exception              $e
param: float                   $time

startTest(PHPUnit_Framework_Test $test)   X-Ref
A test started.

param: PHPUnit_Framework_Test $test

endTest(PHPUnit_Framework_Test $test, $time)   X-Ref
A test ended.

param: PHPUnit_Framework_Test $test
param: float                   $time

startTestSuite(PHPUnit_Framework_TestSuite $suite)   X-Ref
A test suite started.

param: PHPUnit_Framework_TestSuite $suite

endTestSuite(PHPUnit_Framework_TestSuite $suite)   X-Ref
A test suite ended.

param: PHPUnit_Framework_TestSuite $suite

isSlow($time, $slowThreshold)   X-Ref
Whether the given test execution time is considered slow.

param: int $time          Test execution time in milliseconds
param: int $slowThreshold Test execution time at which a test should be considered slow (milliseconds)
return: bool

addSlowTest(PHPUnit_Framework_TestCase $test, $time)   X-Ref
Stores a test as slow.

param: PHPUnit_Framework_TestCase $test
param: int                         $time Test execution time in milliseconds

hasSlowTests()   X-Ref
Whether at least one test has been considered slow.

return: bool

toMilliseconds($time)   X-Ref
Convert PHPUnit's reported test time (microseconds) to milliseconds.

param: float $time
return: int

makeLabel(PHPUnit_Framework_TestCase $test)   X-Ref
Label for describing a test.

param: PHPUnit_Framework_TestCase $test
return: string

getReportLength()   X-Ref
Calculate number of slow tests to report about.

return: int

getHiddenCount()   X-Ref
Find how many slow tests occurred that won't be shown due to list length.

return: int Number of hidden slow tests

renderHeader()   X-Ref
Renders slow test report header.


renderBody()   X-Ref
Renders slow test report body.


renderFooter()   X-Ref
Renders slow test report footer.


loadOptions(array $options)   X-Ref
Populate options into class internals.

param: array $options

getSlowThreshold(PHPUnit_Framework_TestCase $test)   X-Ref
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.

The following test will only be considered slow when its execution time
reaches 5000ms (5 seconds):

<code>
param: PHPUnit_Framework_TestCase $test
return: int



Generated: Mon Jul 22 01:01:32 2019 Cross-referenced by PHPXref 0.7.1