Skip to content

Commit baafa3d

Browse files
test: adjust remember cookie test to add user stub and remove default value from session
1 parent 6600c86 commit baafa3d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/Auth/AuthGuardTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,12 @@ public function testGetIdWhenRememberCookieExistsWillReturnIntegerIdFromCookieVa
380380
$request = Request::create('/', 'GET', [], [
381381
'remember_82e5d2c56bdd0811318f0cf078b78bfc' => '123|recaller'
382382
]);
383+
$user = $this->prophesize(UserInterface::class);
384+
$user->getAuthIdentifier()->willReturn(123);
383385

384-
$this->session->get('login_82e5d2c56bdd0811318f0cf078b78bfc', Argument::any())->will(function ($args) {
385-
return $args[1];
386-
});
386+
$this->userProvider
387+
->retrieveByToken(123, 'recaller')
388+
->willReturn($user->reveal());
387389

388390
$guard = new Guard(
389391
$this->userProvider->reveal(),

0 commit comments

Comments
 (0)