PHP Class PhpBench\Tests\Unit\Util\TimeUnitTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: dantleech/phpbench

Public Methods

Method Description
provideConvert ( )
provideConvertThroughput ( )
testConvert ( $time, $unit, $destUnit, $expectedTime ) It should convertTo one time unit to another.
testConvertThroughput ( $time, $unit, $destUnit, $expectedThroughput ) It should convert one time unit to another in throughput mode.
testDefaultValuesModeAndDestUnit ( ) It should use the default values for mode and dest unit if null values are given.
testDestSuffixDefaultState ( ) It should return the destination suffix for default state.
testDestSuffixGivenState ( ) It should return the destination suffix for a given state.
testFormat ( ) It should format a time into a human readable string.
testGivenValuesModeAndDestUnit ( ) It should use the given values for getDestUnit and getMode.
testInvalidDestFormat ( )
testInvalidSourceFormat ( )
testInvalidUnitType ( )
testOverridePrecision ( ) It should allow the precision to be overriden.
testResolveDestUnitAndModeAndPrecision ( ) It should resolve given values to the overridden values in the case that the values are overridden (dest unit and mode).

Method Details

provideConvert() public method

public provideConvert ( )

provideConvertThroughput() public method

testConvert() public method

It should convertTo one time unit to another.
public testConvert ( $time, $unit, $destUnit, $expectedTime )

testConvertThroughput() public method

It should convert one time unit to another in throughput mode.
public testConvertThroughput ( $time, $unit, $destUnit, $expectedThroughput )

testDefaultValuesModeAndDestUnit() public method

It should use the default values for mode and dest unit if null values are given.

testDestSuffixDefaultState() public method

It should return the destination suffix for default state.

testDestSuffixGivenState() public method

It should return the destination suffix for a given state.

testFormat() public method

It should format a time into a human readable string.
public testFormat ( )

testGivenValuesModeAndDestUnit() public method

It should use the given values for getDestUnit and getMode.

testInvalidDestFormat() public method

testInvalidSourceFormat() public method

testInvalidUnitType() public method

public testInvalidUnitType ( )

testOverridePrecision() public method

It should allow the precision to be overriden.

testResolveDestUnitAndModeAndPrecision() public method

It should resolve given values to the overridden values in the case that the values are overridden (dest unit and mode).