From 87d4149eb87ee6ef485bf5d5d9a17afd8b5f04f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 18 Jul 2012 14:23:06 +0200 Subject: [PATCH 1/2] Set real PMA_VERSION rather than faking it --- test/classes/PMA_PDF_test.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/classes/PMA_PDF_test.php b/test/classes/PMA_PDF_test.php index 19252f6648..a8222833a4 100644 --- a/test/classes/PMA_PDF_test.php +++ b/test/classes/PMA_PDF_test.php @@ -12,13 +12,16 @@ require_once 'libraries/CommonFunctions.class.php'; require_once 'libraries/PDF.class.php'; require_once 'libraries/php-gettext/gettext.inc'; - -if (!defined('PMA_VERSION')) { - define('PMA_VERSION', 'TEST'); -} +require_once 'libraries/core.lib.php'; +require_once 'libraries/Config.class.php'; class PMA_PDF_test extends PHPUnit_Framework_TestCase { + public function setup() + { + $GLOBALS['PMA_Config'] = new PMA_Config(); + $GLOBALS['PMA_Config']->enableBc(); + } /** * @group large */ From a12c0383c6e742021def701d2b4eee60679135b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 18 Jul 2012 14:27:30 +0200 Subject: [PATCH 2/2] Set real PMA_VERSION rather than faking it --- test/libraries/common/PMA_expandUserString_test.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/libraries/common/PMA_expandUserString_test.php b/test/libraries/common/PMA_expandUserString_test.php index a6c9d4ab79..c5b2fb61ba 100644 --- a/test/libraries/common/PMA_expandUserString_test.php +++ b/test/libraries/common/PMA_expandUserString_test.php @@ -12,10 +12,7 @@ */ require_once 'libraries/core.lib.php'; require_once 'libraries/CommonFunctions.class.php'; - -if (!defined('PMA_VERSION')) { - define('PMA_VERSION', 'TEST'); -} +require_once 'libraries/Config.class.php'; /** * Test for PMA_CommonFunctions::expandUserString function. @@ -28,6 +25,8 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase */ public function setup() { + $GLOBALS['PMA_Config'] = new PMA_Config(); + $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg'] = array( 'Server' => array( 'host' => 'host&', @@ -44,6 +43,7 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase */ public function testExpand($in, $out) { + $out = str_replace('PMA_VERSION', PMA_VERSION, $out); $this->assertEquals( $out, PMA_CommonFunctions::getInstance()->expandUserString($in) ); @@ -56,6 +56,7 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase */ public function testExpandEscape($in, $out) { + $out = str_replace('PMA_VERSION', PMA_VERSION, $out); $this->assertEquals( htmlspecialchars($out), PMA_CommonFunctions::getInstance() @@ -76,7 +77,7 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase array('@DATABASE@', 'database'), array('@TABLE@', 'table'), array('@IGNORE@', '@IGNORE@'), - array('@PHPMYADMIN@', 'phpMyAdmin ' . PMA_VERSION), + array('@PHPMYADMIN@', 'phpMyAdmin PMA_VERSION'), ); } }