$request = Request::
create('/', 'GET',
[],
['_remember_me_cookie' => 'rememberme'
]);
$request->attributes->
set(ResponseListener::COOKIE_ATTR_NAME,
new Cookie('_remember_me_cookie', null
));
yield [$request, false
];
$request = Request::
create('/', 'GET',
[],
['_remember_me_cookie' => '0'
]);
yield [$request, false
];
} public function testAuthenticate() { $rememberMeDetails =
new RememberMeDetails(InMemoryUser::
class, 'wouter', 1, 'secret'
);
$request = Request::
create('/', 'GET',
[],
['_remember_me_cookie' =>
$rememberMeDetails->
toString()]);
$passport =
$this->authenticator->
authenticate($request);
$this->rememberMeHandler->
expects($this->
once())->
method('consumeRememberMeCookie'
)->
with($this->
callback(fn ($arg) =>
$rememberMeDetails ==
$arg));
$passport->
getUser(); // trigger the user loader
} public function testAuthenticateWithoutToken() { $this->
expectException(\LogicException::
class);