PHP Class PhpunitMemoryAndTimeUsageListener\Listener\Measurement\TimeAndMemoryTestListener

Inheritance: implements PHPUnit_Framework_TestListener
Datei anzeigen Open project: atrapalo/phpunit-memory-and-time-usage-listener

Protected Properties

Property Type Description
$executionTime PhpunitMemoryAndTimeUsageListener\Domain\Measurement\TimeMeasurement
$executionTimeEdge integer Time in milliseconds we consider a test has a need to see if a refactor is needed
$memoryPeakDifferenceEdge integer Memory bytes usage we consider a test has a need to see if a refactor is needed
$memoryPeakIncrease
$memoryUsage
$memoryUsageEdge integer Memory bytes usage we consider a test has a need to see if a refactor is needed
$showOnlyIfEdgeIsExceeded boolean
$testMeasurementCollection PhpunitMemoryAndTimeUsageListener\Domain\Measurement\TestMeasurement[]
$testSuitesRunning integer

Public Methods

Method Description
__construct ( $configurationOptions = [] )
addError ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $exception, float $time )
addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
addRiskyTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
addSkippedTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
endTest ( PHPUnit_Framework_Test $test, $time )
endTestSuite ( PHPUnit_Framework_TestSuite $suite )
startTest ( PHPUnit_Framework_Test $test )
startTestSuite ( PHPUnit_Framework_TestSuite $suite )

Protected Methods

Method Description
checkEdgeIsOverTaken ( $value, $edgeValue ) : boolean
haveToSaveTestMeasurement ( ) : boolean
isAPotentialCriticalMemoryPeakUsage ( ) : boolean Check if test execution memory peak usage is critical so we need to check it out
isAPotentialCriticalMemoryUsage ( ) : boolean Check if test execution memory usage is critical so we need to check it out
isAPotentialCriticalTimeUsage ( ) : boolean Check if test execution time is critical so we need to check it out
setConfigurationOptions ( $configurationOptions )

Method Details

__construct() public method

public __construct ( $configurationOptions = [] )

addError() public method

public addError ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
$test PHPUnit_Framework_Test
$exception Exception
$time float

addFailure() public method

public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $exception, float $time )
$test PHPUnit_Framework_Test
$exception PHPUnit_Framework_AssertionFailedError
$time float

addIncompleteTest() public method

public addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
$test PHPUnit_Framework_Test
$exception Exception
$time float

addRiskyTest() public method

public addRiskyTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
$test PHPUnit_Framework_Test
$exception Exception
$time float

addSkippedTest() public method

public addSkippedTest ( PHPUnit_Framework_Test $test, Exception $exception, float $time )
$test PHPUnit_Framework_Test
$exception Exception
$time float

checkEdgeIsOverTaken() protected method

protected checkEdgeIsOverTaken ( $value, $edgeValue ) : boolean
$value
$edgeValue
return boolean

endTest() public method

public endTest ( PHPUnit_Framework_Test $test, $time )
$test PHPUnit_Framework_Test
$time

endTestSuite() public method

public endTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

haveToSaveTestMeasurement() protected method

protected haveToSaveTestMeasurement ( ) : boolean
return boolean

isAPotentialCriticalMemoryPeakUsage() protected method

Check if test execution memory peak usage is critical so we need to check it out

isAPotentialCriticalMemoryUsage() protected method

Check if test execution memory usage is critical so we need to check it out

isAPotentialCriticalTimeUsage() protected method

Check if test execution time is critical so we need to check it out

setConfigurationOptions() protected method

protected setConfigurationOptions ( $configurationOptions )
$configurationOptions

startTest() public method

public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

startTestSuite() public method

public startTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

Property Details

$executionTime protected_oe property

protected TimeMeasurement,PhpunitMemoryAndTimeUsageListener\Domain\Measurement $executionTime
return PhpunitMemoryAndTimeUsageListener\Domain\Measurement\TimeMeasurement

$executionTimeEdge protected_oe property

Time in milliseconds we consider a test has a need to see if a refactor is needed
protected int $executionTimeEdge
return integer

$memoryPeakDifferenceEdge protected_oe property

Memory bytes usage we consider a test has a need to see if a refactor is needed
protected int $memoryPeakDifferenceEdge
return integer

$memoryPeakIncrease protected_oe property

protected $memoryPeakIncrease

$memoryUsage protected_oe property

protected $memoryUsage

$memoryUsageEdge protected_oe property

Memory bytes usage we consider a test has a need to see if a refactor is needed
protected int $memoryUsageEdge
return integer

$showOnlyIfEdgeIsExceeded protected_oe property

protected bool $showOnlyIfEdgeIsExceeded
return boolean

$testMeasurementCollection protected_oe property

protected TestMeasurement[],PhpunitMemoryAndTimeUsageListener\Domain\Measurement $testMeasurementCollection
return PhpunitMemoryAndTimeUsageListener\Domain\Measurement\TestMeasurement[]

$testSuitesRunning protected_oe property

protected int $testSuitesRunning
return integer