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 01/17] 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 * From f211f633275b83e1cc6c908deb97d00c43f861c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 11 Jun 2013 13:50:09 +0200 Subject: [PATCH 02/17] Allow test to run standalone --- test/classes/PMA_Config_test.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php index 4120e0c426..b5ce5b5a18 100644 --- a/test/classes/PMA_Config_test.php +++ b/test/classes/PMA_Config_test.php @@ -15,6 +15,8 @@ require_once 'libraries/Config.class.php'; require_once 'libraries/relation.lib.php'; require_once 'libraries/Theme.class.php'; require_once 'libraries/vendor_config.php'; +require_once 'libraries/url_generating.lib.php'; +require_once 'libraries/php-gettext/gettext.inc'; class PMA_ConfigTest extends PHPUnit_Framework_TestCase { @@ -40,6 +42,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase $GLOBALS['server'] = 0; $_SESSION['is_git_revision'] = true; $GLOBALS['PMA_Config'] = new PMA_Config(CONFIG_FILE); + $_SESSION[' PMA_token '] = 'token'; } /** @@ -96,7 +99,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase '