Skip to content

Commit 2965d5d

Browse files
committed
Remove time-sensitivity from LoginLinkHandlerTest
1 parent f5c0263 commit 2965d5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/LoginLink/LoginLinkHandlerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ protected function setUp(): void
5353

5454
/**
5555
* @dataProvider provideCreateLoginLinkData
56-
* @group time-sensitive
5756
*/
5857
public function testCreateLoginLink($user, array $extraProperties, Request $request = null)
5958
{
@@ -65,8 +64,10 @@ public function testCreateLoginLink($user, array $extraProperties, Request $requ
6564
return 'weaverryan' == $parameters['user']
6665
&& isset($parameters['expires'])
6766
&& isset($parameters['hash'])
67+
// allow a small expiration offset to avoid time-sensitivity
68+
&& abs(time() + 600 - $parameters['expires']) <= 1
6869
// make sure hash is what we expect
69-
&& $parameters['hash'] === $this->createSignatureHash('weaverryan', time() + 600, array_values($extraProperties));
70+
&& $parameters['hash'] === $this->createSignatureHash('weaverryan', $parameters['expires'], array_values($extraProperties));
7071
}),
7172
UrlGeneratorInterface::ABSOLUTE_URL
7273
)

0 commit comments

Comments
 (0)