diff --git a/test/libraries/core/PMA_headerLocation_test.php b/test/libraries/core/PMA_headerLocation_test.php index 442d983cc0..bf07ffceb7 100644 --- a/test/libraries/core/PMA_headerLocation_test.php +++ b/test/libraries/core/PMA_headerLocation_test.php @@ -61,29 +61,20 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase */ public function testSendHeaderLocationWithoutSidWithIis() { - if (defined('PMA_TEST_HEADERS')) { + $GLOBALS['PMA_Config']->set('PMA_IS_IIS', true); - $GLOBALS['PMA_Config']->set('PMA_IS_IIS', true); + $testUri = 'https://example.com/test.php'; - $testUri = 'https://example.com/test.php'; + $header = array('Location: ' . $testUri); + PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] + $this->assertEquals($header, $GLOBALS['header']); - $header = array('Location: ' . $testUri); - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - //reset $GLOBALS['header'] for the next assertion - unset($GLOBALS['header']); - - $header = array('Refresh: 0; ' . $testUri); - PMA_sendHeaderLocation($testUri, true); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped( - 'Cannot redefine constant/function - missing runkit extension' - ); - } + //reset $GLOBALS['header'] for the next assertion + unset($GLOBALS['header']); + $header = array('Refresh: 0; ' . $testUri); + PMA_sendHeaderLocation($testUri, true); // sets $GLOBALS['header'] + $this->assertEquals($header, $GLOBALS['header']); } /** @@ -93,20 +84,11 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase */ public function testSendHeaderLocationWithoutSidWithoutIis() { - if (defined('PMA_TEST_HEADERS')) { - - $testUri = 'https://example.com/test.php'; - $header = array('Location: ' . $testUri); - - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped( - 'Cannot redefine constant/function - missing runkit extension' - ); - } + $testUri = 'https://example.com/test.php'; + $header = array('Location: ' . $testUri); + PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] + $this->assertEquals($header, $GLOBALS['header']); } /** @@ -171,4 +153,4 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase $attrInstance->setValue($restoreInstance); } -} +} \ No newline at end of file