Allow test to run standalone

This commit is contained in:
Michal Čihař 2013-06-11 13:48:50 +02:00
parent 3af2a12162
commit c818cc69cf

View File

@ -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(
'<div id="selflink" class="print_ignore"><a href="index.php?db=mysql&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank">Open new phpMyAdmin window</a></div>',
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank">Open new phpMyAdmin window</a></div>',
$this->_callPrivateFunction(
'_getSelfLink',
array(
@ -162,7 +169,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
$GLOBALS['pmaThemeImage'] = 'image';
$this->assertEquals(
'<div id="selflink" class="print_ignore"><a href="index.php?db=mysql&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank"><img src="imagewindow-new.png" title="Open new phpMyAdmin window" alt="Open new phpMyAdmin window" /></a></div>',
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank"><img src="imagewindow-new.png" title="Open new phpMyAdmin window" alt="Open new phpMyAdmin window" /></a></div>',
$this->_callPrivateFunction(
'_getSelfLink',
array(
@ -201,7 +208,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
$footer->getDisplay()
);
}
/**
* Test for footer get Scripts
*