Merge remote-tracking branch 'origin/pull/12793' into tmp

This commit is contained in:
Michal Čihař 2016-12-13 17:21:03 +01:00
commit 9e93ba5b48

View File

@ -364,11 +364,23 @@ 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('header', 'headersSent'))
->getMock();
$mockResponse->expects($this->once())
->method('header')
->with('Location: /phpmyadmin/file.html?a=b&saved=1&server=0#h+ash');
$mockResponse->expects($this->any())
->method('headersSent')
->with()
->will($this->returnValue(false));
$GLOBALS['PMA_Config']->set('PmaAbsoluteUri', '');
$GLOBALS['cfg']['ServerDefault'] = 1;
@ -388,11 +400,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 +456,4 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase
$result
);
}
}
}