Merge pull request #499 from ayushchd/unit_testing

Fix test failures because of header redirect
This commit is contained in:
Michal Čihař 2013-07-15 04:00:24 -07:00
commit 9f84630b96
2 changed files with 11 additions and 4 deletions

View File

@ -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']
);

View File

@ -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) {