PHP 클래스 JohnKary\PHPUnit\Listener\SpeedTrapListener

상속: implements PHPUnit_Framework_TestListener
파일 보기 프로젝트 열기: johnkary/phpunit-speedtrap

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

Construct a new instance.
public __construct ( array $options = [] )
$options array

addError() 공개 메소드

An error occurred.
public addError ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addFailure() 공개 메소드

A failure occurred.
public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_AssertionFailedError
$time float

addIncompleteTest() 공개 메소드

Incomplete test.
public addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addRiskyTest() 공개 메소드

Risky test.
public addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addSkippedTest() 공개 메소드

Skipped test.
public addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addSlowTest() 보호된 메소드

Stores a test as slow.
protected addSlowTest ( PHPUnit_Framework_TestCase $test, integer $time )
$test PHPUnit_Framework_TestCase
$time integer Test execution time in milliseconds

endTest() 공개 메소드

A test ended.
public endTest ( PHPUnit_Framework_Test $test, float $time )
$test PHPUnit_Framework_Test
$time float

endTestSuite() 공개 메소드

A test suite ended.
public endTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

getHiddenCount() 보호된 메소드

Find how many slow tests occurred that won't be shown due to list length.
protected getHiddenCount ( ) : integer
리턴 integer Number of hidden slow tests

getReportLength() 보호된 메소드

Calculate number of slow tests to report about.
protected getReportLength ( ) : integer
리턴 integer

getSlowThreshold() 보호된 메소드

The following test will only be considered slow when its execution time reaches 5000ms (5 seconds): \@slowThreshold 5000 public function testLongRunningProcess() }
protected getSlowThreshold ( PHPUnit_Framework_TestCase $test ) : integer
$test PHPUnit_Framework_TestCase
리턴 integer

hasSlowTests() 보호된 메소드

Whether at least one test has been considered slow.
protected hasSlowTests ( ) : boolean
리턴 boolean

isSlow() 보호된 메소드

Whether the given test execution time is considered slow.
protected isSlow ( integer $time, integer $slowThreshold ) : boolean
$time integer Test execution time in milliseconds
$slowThreshold integer Test execution time at which a test should be considered slow (milliseconds)
리턴 boolean

loadOptions() 보호된 메소드

Populate options into class internals.
protected loadOptions ( array $options )
$options array

makeLabel() 보호된 메소드

Label for describing a test.
protected makeLabel ( PHPUnit_Framework_TestCase $test ) : string
$test PHPUnit_Framework_TestCase
리턴 string

renderBody() 보호된 메소드

Renders slow test report body.
protected renderBody ( )

renderFooter() 보호된 메소드

Renders slow test report footer.
protected renderFooter ( )

renderHeader() 보호된 메소드

Renders slow test report header.
protected renderHeader ( )

startTest() 공개 메소드

A test started.
public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

startTestSuite() 공개 메소드

A test suite started.
public startTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

toMilliseconds() 보호된 메소드

Convert PHPUnit's reported test time (microseconds) to milliseconds.
protected toMilliseconds ( float $time ) : integer
$time float
리턴 integer

프로퍼티 상세

$reportLength 보호되어 있는 프로퍼티

Number of tests to report on for slowness.
protected int $reportLength
리턴 integer

$slow 보호되어 있는 프로퍼티

Collection of slow tests.
protected array $slow
리턴 array

$slowThreshold 보호되어 있는 프로퍼티

Time in milliseconds at which a test will be considered "slow" and be reported by this listener.
protected int $slowThreshold
리턴 integer

$suites 보호되어 있는 프로퍼티

Increments as more suites are run, then decremented as they finish. All suites have been run when returns to 0.
protected int $suites
리턴 integer