From 20698d1c5718241597861819ff628200dd5e71d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 11 Jun 2013 14:43:25 +0200 Subject: [PATCH] Fix test to work without preconfigured globals --- test/classes/config/PMA_Form_test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/classes/config/PMA_Form_test.php b/test/classes/config/PMA_Form_test.php index 4cf9bdaff9..150078992a 100644 --- a/test/classes/config/PMA_Form_test.php +++ b/test/classes/config/PMA_Form_test.php @@ -9,11 +9,28 @@ require_once 'libraries/config/ConfigFile.class.php'; require_once 'libraries/config/Form.class.php'; require_once 'libraries/Util.class.php'; +require_once 'libraries/Theme.class.php'; +require_once 'libraries/Config.class.php'; require_once 'libraries/php-gettext/gettext.inc'; class PMA_Form_Test extends PHPUnit_Framework_TestCase { + /** + * Configures global environment. + * + * @return void + */ + function setup() + { + $_SESSION['PMA_Theme'] = new PMA_Theme(); + $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath(); + $GLOBALS['pmaThemeImage'] = 'theme/'; + $GLOBALS['PMA_Config'] = new PMA_Config(); + $GLOBALS['PMA_Config']->enableBc(); + $GLOBALS['server'] = 0; + } + public function testContructor() { $form = new Form('pma_form_name', array('pma_form1','pma_form2'), 1);