AuthenticationCookieTest::testLogout PHP Method

testLogout() public method

Test for PMA\libraries\plugins\auth\AuthenticationConfig::authCheck
public testLogout ( ) : void
return void
    public function testLogout()
    {
        $restoreInstance = PMA\libraries\Response::getInstance();
        $mockResponse = $this->getMockBuilder('PMA\\libraries\\Response')->disableOriginalConstructor()->setMethods(array('isAjax', 'headersSent', 'header'))->getMock();
        $mockResponse->expects($this->any())->method('headersSent')->with()->will($this->returnValue(false));
        $mockResponse->expects($this->once())->method('header')->with('Location: /phpmyadmin/index.php');
        $attrInstance = new ReflectionProperty('PMA\\libraries\\Response', '_instance');
        $attrInstance->setAccessible(true);
        $attrInstance->setValue($mockResponse);
        $GLOBALS['cfg']['CaptchaLoginPrivateKey'] = '';
        $GLOBALS['cfg']['CaptchaLoginPublicKey'] = '';
        $GLOBALS['cfg']['LoginCookieDeleteAll'] = false;
        $GLOBALS['PMA_Config']->set('PmaAbsoluteUri', '');
        $GLOBALS['cfg']['Servers'] = array(1);
        $GLOBALS['server'] = 1;
        $_COOKIE['pmaAuth-1'] = 'test';
        $this->object->logOut();
        $this->assertFalse(isset($_COOKIE['pmaAuth-1']));
        $attrInstance->setValue($restoreInstance);
    }