예제 #1
0
 public function succeeds_trying_to_acquire_one_more_than_permitted_after_longer_timeout($rate)
 {
     $fixture = new RateLimiting($rate, self::$clock);
     $fixture->acquire($rate);
     $this->assertTrue($fixture->tryAcquiring(1, $fixture->rate()->unit()->seconds() + 0.5));
 }
예제 #2
0
 public function increase()
 {
     $fixture = new RateLimiting(self::RATE);
     $fixture->increase(100);
     $this->assertEquals(new Rate(self::RATE + 100, Per::$SECOND), $fixture->rate());
 }