AuthenticationCookieTest::testAuthHeader PHP Method

testAuthHeader() public method

Test for PMA\libraries\plugins\auth\AuthenticationConfig::auth with headers
public testAuthHeader ( ) : void
return void
    public function testAuthHeader()
    {
        $GLOBALS['cfg']['LoginCookieDeleteAll'] = false;
        $GLOBALS['cfg']['Servers'] = array(1);
        $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: https://example.com/logout');
        $attrInstance = new ReflectionProperty('PMA\\libraries\\Response', '_instance');
        $attrInstance->setAccessible(true);
        $attrInstance->setValue($mockResponse);
        $GLOBALS['cfg']['Server']['LogoutURL'] = 'https://example.com/logout';
        $this->object->logOut();
        $attrInstance->setValue($restoreInstance);
    }