From c818cc69cf6e9f5fc460fffb169e4edfb8eccf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 11 Jun 2013 13:48:50 +0200 Subject: [PATCH] Allow test to run standalone --- test/classes/PMA_Footer_test.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php index efe5ffe3be..5d284736c4 100644 --- a/test/classes/PMA_Footer_test.php +++ b/test/classes/PMA_Footer_test.php @@ -16,7 +16,9 @@ require_once 'libraries/core.lib.php'; require_once 'libraries/url_generating.lib.php'; require_once 'libraries/php-gettext/gettext.inc'; require_once 'libraries/Util.class.php'; +require_once 'libraries/Config.class.php'; require_once 'libraries/Theme.class.php'; +require_once 'libraries/Table.class.php'; require_once 'libraries/Error_Handler.class.php'; require_once 'libraries/vendor_config.php'; @@ -48,13 +50,18 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase protected function setUp() { $_SERVER['SCRIPT_NAME'] = 'index.php'; - $GLOBALS['db'] = 'mysql'; + $GLOBALS['PMA_PHP_SELF'] = 'index.php'; + $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; $GLOBALS['lang'] = 'en'; + $GLOBALS['text_dir'] = 'ltr'; + $GLOBALS['PMA_Config'] = new PMA_Config(); + $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['collation_connection'] = 'utf8_general_ci'; $GLOBALS['cfg']['Error_Handler']['gather'] = false; $GLOBALS['cfg']['Error_Handler']['display'] = false; $GLOBALS['cfg']['Server']['verbose'] = 'verbose host'; + $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php'; $GLOBALS['server'] = '1'; $_SESSION[' PMA_token '] = 'token'; $_GET['reload_left_frame'] = '1'; @@ -138,7 +145,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['ServerDefault'] = 1; $this->assertEquals( - '', + '', $this->_callPrivateFunction( '_getSelfLink', array( @@ -162,7 +169,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase $GLOBALS['pmaThemeImage'] = 'image'; $this->assertEquals( - '', + '', $this->_callPrivateFunction( '_getSelfLink', array( @@ -201,7 +208,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase $footer->getDisplay() ); } - + /** * Test for footer get Scripts *