/** * Test for AuthenticationConfig::auth with headers * * @return void */ public function testAuthHeader() { if (!defined('PMA_TEST_HEADERS')) { $this->markTestSkipped('Cannot redefine constant/function - missing runkit extension'); } $restoreInstance = PMA_Response::getInstance(); $mockResponse = $this->getMockBuilder('PMA_Response')->disableOriginalConstructor()->setMethods(array('isAjax'))->getMock(); $mockResponse->expects($this->once())->method('isAjax')->with()->will($this->returnValue(false)); $attrInstance = new ReflectionProperty('PMA_Response', '_instance'); $attrInstance->setAccessible(true); $attrInstance->setValue($mockResponse); $_REQUEST['old_usr'] = '******'; $GLOBALS['cfg']['Server']['LogoutURL'] = 'http://www.phpmyadmin.net/logout'; $this->assertTrue($this->object->auth()); $this->assertContains('Location: http://www.phpmyadmin.net/logout?PHPSESSID=', $GLOBALS['header'][0]); $attrInstance->setValue($restoreInstance); }