eZ\Publish\Core\REST\Server\Tests\Security\RestSessionBasedAuthenticatorTest::testLogout PHP Method

testLogout() public method

public testLogout ( )
    public function testLogout()
    {
        $sessionLogoutHandler = $this->getMock('Symfony\\Component\\Security\\Http\\Logout\\SessionLogoutHandler');
        $sessionLogoutHandler->expects($this->never())->method('logout');
        $token = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');
        $this->tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($token));
        $request = new Request();
        $logoutHandler1 = $this->getMock('Symfony\\Component\\Security\\Http\\Logout\\LogoutHandlerInterface');
        $logoutHandler1->expects($this->once())->method('logout')->with($request, $this->isInstanceOf('Symfony\\Component\\HttpFoundation\\Response'), $token);
        $logoutHandler2 = $this->getMock('Symfony\\Component\\Security\\Http\\Logout\\LogoutHandlerInterface');
        $logoutHandler2->expects($this->once())->method('logout')->with($request, $this->isInstanceOf('Symfony\\Component\\HttpFoundation\\Response'), $token);
        $this->authenticator->addLogoutHandler($sessionLogoutHandler);
        $this->authenticator->addLogoutHandler($logoutHandler1);
        $this->authenticator->addLogoutHandler($logoutHandler2);
        $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $this->authenticator->logout($request));
    }