PHP Class ProgressBar\Test\ManagerTest

Inheritance: extends PHPUnit_Framework_TestCase
Exibir arquivo Open project: guiguiboy/php-cli-progress-bar

Public Methods

Method Description
setUp ( ) As Manager prints on stdout, we use output buffering for the tests
tearDown ( ) Clean output buffer after each test
testAdvance ( ) Tests the advance method.
testCustomReplacementRule ( ) Tests the use of custom replacements rules
testEta ( ) Tests ETA
testLowerIncrementThrowsException ( ) Tests that a lower increment throws an InvalidArgumentException
testManagerFormat ( ) Test format getter and setter
testMaxWidth ( ) Tests that the bar width does not exceed the max width specified in constructor.
testNonIntegerIncrementThrowsException ( ) Tests that a non integer increment throws an InvalidArgumentException
testProgressOverflow ( ) Tests the situation when the value given to progressbar is greater than the manager size.
testUpdate ( ) Tests update When there is still work to do : print the bar with \r When it s finished : print the bar with \n

Method Details

setUp() public method

As Manager prints on stdout, we use output buffering for the tests
public setUp ( )

tearDown() public method

Clean output buffer after each test
public tearDown ( )

testAdvance() public method

Advancing the progress bar should make one step further.
public testAdvance ( )

testCustomReplacementRule() public method

Tests the use of custom replacements rules

testEta() public method

Tests ETA
public testEta ( )

testLowerIncrementThrowsException() public method

Tests that a lower increment throws an InvalidArgumentException

testManagerFormat() public method

Test format getter and setter
public testManagerFormat ( )

testMaxWidth() public method

Tests that the bar width does not exceed the max width specified in constructor.
public testMaxWidth ( )

testNonIntegerIncrementThrowsException() public method

Tests that a non integer increment throws an InvalidArgumentException

testProgressOverflow() public method

Tests the situation when the value given to progressbar is greater than the manager size.

testUpdate() public method

Tests update When there is still work to do : print the bar with \r When it s finished : print the bar with \n
public testUpdate ( )