8000 [TASK] Add test · symfony/symfony@5669336 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5669336

Browse files
committed
[TASK] Add test
1 parent ca4f93c commit 5669336

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/RateLimiter/Tests/Policy/SlidingWindowTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public function testGetExpirationTime()
3434

3535
$new = SlidingWindow::createFromPreviousWindow($cachedWindow, 15);
3636
$this->assertSame(2 * 15, $new->getExpirationTime());
37+
38+
usleep(10.1);
39+
$this->assertIsInt($new->getExpirationTime());
3740
}
3841

3942
public function testInvalidInterval()
@@ -90,7 +93,6 @@ public function testIsExpiredUsesMicrotime()
9093
{
9194
ClockMock::register(SlidingWindow::class);
9295
$window = new SlidingWindow('foo', 10);
93-
9496
usleep(10.1 * 1e6);
9597
$this->assertTrue($window->isExpired());
9698
}

0 commit comments

Comments
 (0)
0