$this->expectException(\LogicException::class); $this->expectExceptionMessage('Cannot reserve more tokens (15) than the burst size of the rate limiter (10).');
// enough free tokens
$this->assertEquals(0, $limiter->reserve(10, 300)->getWaitDuration()); // waiting time within set maximum
$this->assertEquals(300, $limiter->reserve(5, 300)->getWaitDuration()); // waiting time exceeded maximum time (as 5 tokens are already reserved)
$limiter->reserve(5, 300); }