Skip to content

Commit

Permalink
ensure consistent window in password test
Browse files Browse the repository at this point in the history
  • Loading branch information
pradtke committed May 16, 2024
1 parent 0b975eb commit da831cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/src/Limiters/PasswordStuffingLimiterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function getLimiter(array $config): UserPassBaseLimiter
public function testKeyVariesWithWindow(): void
{
$config = [
'window' => 'PT2S'
'window' => 'PT3S'
];

$limiter = $this->getLimiter($config);
Expand All @@ -38,6 +38,7 @@ public function testKeyVariesWithWindow(): void
$this->assertEquals($result, $limiter->getRateLimitKey('abc', $password));

$this->sleepTillNextWindow($startingWindow, $limiter);
$this->waitTillWindowHasAtLeastMinTime($limiter, 1);
// Next window should have different keys
$newKey = $limiter->getRateLimitKey('efg', $password);
$this->assertNotEquals($result, $newKey, 'Key should vary with window');
Expand Down

0 comments on commit da831cf

Please sign in to comment.