$request =
$this->
createMock(Request::
class);
$requestStack->
method('getCurrentRequest'
)->
willReturn($request);
$this->tokenStorage =
new TokenStorage();
$this->generator =
new LogoutUrlGenerator($requestStack, null,
$this->tokenStorage
);
} public function testGetLogoutPath() { $this->generator->
registerListener('secured_area', '/logout', null, null
);
$this->
assertSame('/logout',
$this->generator->
getLogoutPath('secured_area'
));
} public function testGetLogoutPathWithoutLogoutListenerRegisteredForKeyThrowsException() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessage('No LogoutListener found for firewall key "unregistered_key".'
);
$this->generator->
registerListener('secured_area', '/logout', null, null, null
);
$this->generator->
getLogoutPath('unregistered_key'
);
}