Метод |
Описание |
|
getTokensShouldReturnCapacityAfterWaitingLongerThanRefillPeriod ( ) |
After waiting longer than the complete refill period on an empty bucket,
getTokens() should return the capacity of the bucket. |
|
getTokensShouldReturnCapacityAfterWaitingRefillPeriod ( ) |
After waiting the complete refill period on an empty bucket, getTokens()
should return the capacity of the bucket. |
|
getTokensShouldReturnInitialAmountOnBootstrap ( ) |
After bootstraping, getTokens() should return the initial amount. |
|
getTokensShouldReturnMoreAfterWaiting ( ) |
After waiting on an non full bucket, getTokens() should return more. |
|
getTokensShouldReturnRemainingTokensAfterConsumption ( ) |
After one consumtion, getTokens() should return the initial amount - 1. |
|
getTokensShouldReturnSameAfterConsumingTooMany ( ) |
After consuming too many, getTokens() should return the same as before. |
|
getTokensShouldReturnZeroTokensAfterConsumingAll ( ) |
After consuming all, getTokens() should return 0. |
|
provideTestBootstrapWithInitialTokens ( ) : int[][] |
Returns test cases for testBootstrapWithInitialTokens(). |
|
provideTestInvalidCapacity ( ) : array |
Provides tests cases for testInvalidCapacity(). |
|
testBootstrapOnce ( ) |
Tests bootstrap() is bootstraps not on already bootstrapped storages. |
|
testBootstrapWithInitialTokens ( integer $capacity, integer $tokens ) |
Tests bootstrapping with tokens. |
|
testCapacity ( ) |
Test the capacity limit of the bucket |
|
testConsume ( ) |
Tests comsumption of cumulated tokens. |
|
testConsumeInsufficientDontRemoveTokens ( ) |
Tests consuming insuficient tokens wont remove any token. |
|
testConsumeSufficientRemoveTokens ( ) |
Tests consuming tokens. |
|
testConsumeTooMany ( ) |
Tests consuming more than the capacity. |
|
testDefaultBootstrap ( ) |
Tests bootstrapping sets to 0 tokens. |
|
testInitialTokensTooMany ( ) |
Tests bootstrapping with too many tokens. |
|
testInvalidCapacity ( $capacity ) |
Tests building a token bucket with an invalid caüacity fails. |
|
testWaitCalculation ( ) |
Tests consume() returns the expected amount of seconds to wait. |
|
testWaitingAddsTokens ( ) |
Test token rate. |
|