From 878488d4693eec00f642a71edf1ea2ad93b82d03 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 1 Oct 2013 17:39:37 +0530 Subject: [PATCH] Do not hard code PMA version in tests --- test/libraries/PMA_ConfigGenerator_test.php | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/test/libraries/PMA_ConfigGenerator_test.php b/test/libraries/PMA_ConfigGenerator_test.php index 41912fa0a4..154b9adc08 100644 --- a/test/libraries/PMA_ConfigGenerator_test.php +++ b/test/libraries/PMA_ConfigGenerator_test.php @@ -24,15 +24,15 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase /** * Test for ConfigGenerator::getConfigFile - * + * * @return void */ public function testGetConfigFile() - { + { $GLOBALS['cfg']['AvailableCharsets'] = array(); $GLOBALS['PMA_Config'] = new PMA_Config(); unset($_SESSION['eol']); - + $attr_instance = new ReflectionProperty("ConfigFile", "_instance"); $attr_instance->setAccessible(true); $attr_instance->setValue(null, null); @@ -45,14 +45,15 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase ); $cf->setPersistKeys(array("1/", 2)); - + $result = ConfigGenerator::getConfigFile(); - + $this->assertContains( "get('PMA_VERSION') . " setup script\n" . " * Date: " . date(DATE_RFC1123) ."\n" . " */\n\n", $result @@ -78,7 +79,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase /** * Test for ConfigGenerator::_getVarExport - * + * * @return void */ public function testGetVarExport() @@ -86,7 +87,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase $reflection = new \ReflectionClass('ConfigGenerator'); $method = $reflection->getMethod('_getVarExport'); $method->setAccessible(true); - + $this->assertEquals( '$cfg[\'var_name\'] = 1;' ."\n", $method->invoke(null, 'var_name', 1, "\n") @@ -107,9 +108,9 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase "\n" ) ); - + $this->assertEquals( - '$cfg[\'var_name\'][\'1a\'] = \'foo\';' . "\n" . + '$cfg[\'var_name\'][\'1a\'] = \'foo\';' . "\n" . '$cfg[\'var_name\'][\'b\'] = \'bar\';' . "\n", $method->invoke( null, @@ -125,11 +126,11 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase /** * Test for ConfigGenerator::_isZeroBasedArray - * + * * @return void */ public function testIsZeroBasedArray() - { + { $reflection = new \ReflectionClass('ConfigGenerator'); $method = $reflection->getMethod('_isZeroBasedArray'); $method->setAccessible(true); @@ -172,7 +173,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase /** * Test for ConfigGenerator::_exportZeroBasedArray - * + * * @return void */ public function testExportZeroBasedArray() @@ -193,7 +194,7 @@ class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase $arr = array(1, 2, 3, 4, 7, 'foo'); $result = $method->invoke(null, $arr, "\n"); - + $this->assertEquals( 'array(' . "\n" . ' 1,' . "\n" .