public function getTokensShouldReturnRemainingTokensAfterConsumption() { $rate = new Rate(1, Rate::SECOND); $bucket = new TokenBucket(10, $rate, new SingleProcessStorage()); $bucket->bootstrap(10); $bucket->consume(1); $this->assertEquals(9, $bucket->getTokens()); }