public function testLogout()
{
$session = $this->getMock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
$sessionId = 'eZSESSID';
$session->expects($this->once())->method('getName')->will($this->returnValue($sessionId));
$request = new Request();
$request->setSession($session);
$request->attributes->set('is_rest_request', true);
$response = new Response();
$response->headers = $this->getMock('Symfony\\Component\\HttpFoundation\\ResponseHeaderBag');
$response->headers->expects($this->once())->method('clearCookie')->with($sessionId);
$logoutHandler = new RestLogoutHandler();
$logoutHandler->logout($request, $response, $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface'));
}