Skip to content

Commit 634f348

Browse files
Fix tests
1 parent 391c182 commit 634f348

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/LoginLink/LoginLinkHandlerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\PropertyAccess\PropertyAccess;
1818
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
1919
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
20+
use Symfony\Component\Routing\RequestContext;
2021
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
2122
use Symfony\Component\Security\Core\User\UserInterface;
2223
use Symfony\Component\Security\Core\User\UserProviderInterface;
@@ -65,6 +66,12 @@ public function testCreateLoginLink($user, array $extraProperties, Request $requ
6566
)
6667
->willReturn('https://example.com/login/verify?user=weaverryan&hash=abchash&expires=1601235000');
6768

69+
if ($request) {
70+
$this->router->expects($this->once())
71+
->method('getContext')
72+
->willReturn(new RequestContext());
73+
}
74+
6875
$loginLink = $this->createLinker([], array_keys($extraProperties))->createLoginLink($user, $request);
6976
$this->assertSame('https://example.com/login/verify?user=weaverryan&hash=abchash&expires=1601235000', $loginLink->getUrl());
7077
}

0 commit comments

Comments
 (0)