From 3f646649ea82a5f13f391fb72876d53751eb4527 Mon Sep 17 00:00:00 2001 From: ayushchd Date: Mon, 15 Jul 2013 16:28:42 +0545 Subject: [PATCH] Fix test failures because of header redirect --- test/libraries/PMA_Form_Processing_test.php | 7 ++++++- test/libraries/PMA_user_preferences_test.php | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/test/libraries/PMA_Form_Processing_test.php b/test/libraries/PMA_Form_Processing_test.php index bfc3d95f82..6be1d49908 100644 --- a/test/libraries/PMA_Form_Processing_test.php +++ b/test/libraries/PMA_Form_Processing_test.php @@ -29,6 +29,11 @@ class PMA_From_Processing_Test extends PHPUnit_Framework_TestCase */ public function testProcessFormSet() { + if (!defined('PMA_TEST_HEADERS')) { + $this->markTestSkipped( + 'Cannot redefine constant/function - missing runkit extension' + ); + } // case 1 $formDisplay = $this->getMockBuilder('FormDisplay') @@ -106,7 +111,7 @@ class PMA_From_Processing_Test extends PHPUnit_Framework_TestCase process_formset($formDisplay); $this->assertEquals( - 'HTTP/1.1 303 See OtherLocation: index.php', + array('HTTP/1.1 303 See Other', 'Location: index.php'), $GLOBALS['header'] ); diff --git a/test/libraries/PMA_user_preferences_test.php b/test/libraries/PMA_user_preferences_test.php index 380a691e00..620081221b 100644 --- a/test/libraries/PMA_user_preferences_test.php +++ b/test/libraries/PMA_user_preferences_test.php @@ -354,8 +354,10 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase */ public function testUserprefsRedirect() { - if (! PMA_HAS_RUNKIT) { - $this->markTestSkipped('Cannot redefine constant'); + if (!defined('PMA_TEST_HEADERS')) { + $this->markTestSkipped( + 'Cannot redefine constant/function - missing runkit extension' + ); } $GLOBALS['cfg']['PmaAbsoluteUri'] = 'http://www.phpmyadmin.net'; @@ -379,7 +381,7 @@ class PMA_User_Preferences_Test extends PHPUnit_Framework_TestCase $this->assertContains( 'Location: http://www.phpmyadmin.netfile.html?a=b&saved=1&server=0&' . 'token=token#h+ash', - $GLOBALS['header'] + $GLOBALS['header'][0] ); if ($redefine !== null) {