Implemented header auth

This commit is contained in:
osaid 2016-12-07 19:42:05 +05:30
parent 8b9a00d80f
commit 1beb8130ad

View File

@ -364,11 +364,25 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
*/
public function testUserprefsRedirect()
{
if (!defined('PMA_TEST_HEADERS')) {
$this->markTestSkipped(
'Cannot redefine constant/function - missing runkit extension'
$restoreInstance = PMA\libraries\Response::getInstance();
$mockResponse = $this->getMockBuilder('PMA\libraries\Response')
->disableOriginalConstructor()
->setMethods(array('headersSent', 'header'))
->getMock();
$mockResponse->expects($this->any())
->method('headersSent')
->with()
->will($this->returnValue(false));
$mockResponse->expects($this->once())
->method('header')
->with(
$this->stringContains('Location: /phpmyadmin/file.html?a=b&saved=1&server=0#h+ash')
);
}
$GLOBALS['PMA_Config']->set('PmaAbsoluteUri', '');
$GLOBALS['cfg']['ServerDefault'] = 1;
@ -388,11 +402,6 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
'h ash'
);
$this->assertContains(
'Location: /phpmyadmin/file.html?a=b&saved=1&server=0#h+ash',
$GLOBALS['header'][0]
);
if ($redefine !== null) {
runkit_constant_redefine('PMA_IS_IIS', $redefine);
} else {
@ -449,4 +458,4 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$result
);
}
}
}