From 184316d891816c15abc3a077e6f2942de147f44e Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sun, 3 Nov 2013 19:00:41 +0530 Subject: [PATCH 1/5] Coding style fixes --- libraries/config/ConfigFile.class.php | 12 +- libraries/config/Form.class.php | 13 +- libraries/config/FormDisplay.class.php | 8 +- libraries/config/Validator.class.php | 11 +- libraries/core.lib.php | 4 +- libraries/user_preferences.lib.php | 1 + setup/config.php | 5 +- setup/lib/ConfigGenerator.class.php | 18 ++- test/classes/config/PMA_Form_test.php | 32 ++--- .../auth/PMA_AuthenticationCookie_test.php | 3 +- test/libraries/PMA_ConfigFile_test.php | 116 +++++++++++------- test/libraries/PMA_SetupIndex_test.php | 4 +- 12 files changed, 143 insertions(+), 84 deletions(-) diff --git a/libraries/config/ConfigFile.class.php b/libraries/config/ConfigFile.class.php index f145fa0c76..51b0245cbc 100644 --- a/libraries/config/ConfigFile.class.php +++ b/libraries/config/ConfigFile.class.php @@ -73,7 +73,8 @@ class ConfigFile /** * Constructor * - * @param array $base_config base configuration read from {@link PMA_Config::$base_config}, + * @param array $base_config base configuration read from + * {@link PMA_Config::$base_config}, * use only when not in PMA Setup */ public function __construct(array $base_config = null) @@ -209,7 +210,8 @@ class ConfigFile $remove_path = $value === $default_value; if ($this->_isInSetup) { // remove if it has a default value or is empty - $remove_path = $remove_path || (empty($value) && empty($default_value)); + $remove_path = $remove_path + || (empty($value) && empty($default_value)); } else { // get original config values not overwritten by user // preferences to allow for overwriting options set in @@ -218,8 +220,10 @@ class ConfigFile $canonical_path, $this->_baseCfg ); - // remove if it has a default value and base config (config.inc.php) uses default value - $remove_path = $remove_path && ($instance_default_value === $default_value); + // remove if it has a default value and base config (config.inc.php) + // uses default value + $remove_path = $remove_path + && ($instance_default_value === $default_value); } if ($remove_path) { PMA_arrayRemove($path, $_SESSION[$this->_id]); diff --git a/libraries/config/Form.class.php b/libraries/config/Form.class.php index f8d26ef0dd..b8b55bcc8a 100644 --- a/libraries/config/Form.class.php +++ b/libraries/config/Form.class.php @@ -53,13 +53,14 @@ class Form /** * Constructor, reads default config values * - * @param string $form_name Form name - * @param array $form Form data - * @param ConfigFile $cf Config file instance - * @param int $index arbitrary index, stored in Form::$index + * @param string $form_name Form name + * @param array $form Form data + * @param ConfigFile $cf Config file instance + * @param int $index arbitrary index, stored in Form::$index */ - public function __construct($form_name, array $form, ConfigFile $cf, $index = null) - { + public function __construct( + $form_name, array $form, ConfigFile $cf, $index = null + ) { $this->index = $index; $this->_configFile = $cf; $this->loadForm($form_name, $form); diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index db2f884a64..74e326a2f5 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -124,7 +124,9 @@ class FormDisplay */ public function registerForm($form_name, array $form, $server_id = null) { - $this->_forms[$form_name] = new Form($form_name, $form, $this->_configFile, $server_id); + $this->_forms[$form_name] = new Form( + $form_name, $form, $this->_configFile, $server_id + ); $this->_isValidated = false; foreach ($this->_forms[$form_name]->fields as $path) { $work_path = $server_id === null @@ -182,7 +184,9 @@ class FormDisplay } // run validation - $errors = PMA_Validator::validate($this->_configFile, $paths, $values, false); + $errors = PMA_Validator::validate( + $this->_configFile, $paths, $values, false + ); // change error keys from canonical paths to work paths if (is_array($errors) && count($errors) > 0) { diff --git a/libraries/config/Validator.class.php b/libraries/config/Validator.class.php index 0a885689bc..e6a958880f 100644 --- a/libraries/config/Validator.class.php +++ b/libraries/config/Validator.class.php @@ -26,6 +26,7 @@ class PMA_Validator * Returns validator list * * @param ConfigFile $cf Config file instance + * * @return array */ public static function getValidators(ConfigFile $cf) @@ -49,7 +50,8 @@ class PMA_Validator for ($i = 1; $i < count($uv); $i++) { if (substr($uv[$i], 0, 6) == 'value:') { $uv[$i] = PMA_arrayRead( - substr($uv[$i], 6), $GLOBALS['PMA_Config']->base_settings + substr($uv[$i], 6), + $GLOBALS['PMA_Config']->base_settings ); } } @@ -72,7 +74,7 @@ class PMA_Validator * cleanup in HTML documen * o false - when no validators match name(s) given by $validator_id * - * @param ConfigFile $cf Config file instance + * @param ConfigFile $cf Config file instance * @param string|array $validator_id ID of validator(s) to run * @param array &$values Values to validate * @param bool $isPostSource tells whether $values are directly from @@ -80,8 +82,9 @@ class PMA_Validator * * @return bool|array */ - public static function validate(ConfigFile $cf, $validator_id, &$values, $isPostSource) - { + public static function validate( + ConfigFile $cf, $validator_id, &$values, $isPostSource + ) { // find validators $validator_id = (array) $validator_id; $validators = static::getValidators($cf); diff --git a/libraries/core.lib.php b/libraries/core.lib.php index c58ad31a4f..d27788d333 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -659,8 +659,8 @@ function PMA_downloadHeader($filename, $mimetype, $length = 0, $no_cache = true) * $path is a string describing position of an element in an associative array, * eg. Servers/1/host refers to $array[Servers][1][host] * - * @param string $path path in the arry - * @param array $array the array + * @param string $path path in the arry + * @param array $array the array * * @return mixed array element or $default */ diff --git a/libraries/user_preferences.lib.php b/libraries/user_preferences.lib.php index 3974c628a0..4b979145ad 100644 --- a/libraries/user_preferences.lib.php +++ b/libraries/user_preferences.lib.php @@ -13,6 +13,7 @@ if (! defined('PHPMYADMIN')) { * Common initialization for user preferences modification pages * * @param ConfigFile $cf Config file instance + * * @return void */ function PMA_userprefsPageInit(ConfigFile $cf) diff --git a/setup/config.php b/setup/config.php index 9074ebe5ac..ffe65915ed 100644 --- a/setup/config.php +++ b/setup/config.php @@ -45,7 +45,10 @@ if (PMA_ifSetOr($_POST['submit_clear'], '')) { // // Save generated config file on the server // - file_put_contents($config_file_path, ConfigGenerator::getConfigFile($GLOBALS['ConfigFile'])); + file_put_contents( + $config_file_path, + ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']) + ); header('HTTP/1.1 303 See Other'); header('Location: index.php?action_done=config_saved'); exit; diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php index d734cbc755..279c071ac0 100644 --- a/setup/lib/ConfigGenerator.class.php +++ b/setup/lib/ConfigGenerator.class.php @@ -17,11 +17,14 @@ class ConfigGenerator * Creates config file * * @param ConfigFile $cf Config file instance + * * @return string */ public static function getConfigFile(ConfigFile $cf) { - $crlf = (isset($_SESSION['eol']) && $_SESSION['eol'] == 'win') ? "\r\n" : "\n"; + $crlf = (isset($_SESSION['eol']) && $_SESSION['eol'] == 'win') + ? "\r\n" + : "\n"; $c = $cf->getConfig(); // header @@ -38,7 +41,9 @@ class ConfigGenerator if ($cf->getServerCount() > 0) { $ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf; foreach ($c['Servers'] as $id => $server) { - $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf + $ret .= '/* Server: ' + . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') + . "*/" . $crlf . '$i++;' . $crlf; foreach ($server as $k => $v) { $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); @@ -88,17 +93,20 @@ class ConfigGenerator private static function _getVarExport($var_name, $var_value, $crlf) { if (!is_array($var_value) || empty($var_value)) { - return "\$cfg['$var_name'] = " . var_export($var_value, true) . ';' . $crlf; + return "\$cfg['$var_name'] = " + . var_export($var_value, true) . ';' . $crlf; } $ret = ''; if (self::_isZeroBasedArray($var_value)) { - $ret = "\$cfg['$var_name'] = " . self::_exportZeroBasedArray($var_value, $crlf) + $ret = "\$cfg['$var_name'] = " + . self::_exportZeroBasedArray($var_value, $crlf) . ';' . $crlf; } else { // string keys: $cfg[key][subkey] = value foreach ($var_value as $k => $v) { $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= "\$cfg['$var_name']['$k'] = " . var_export($v, true) . ';' . $crlf; + $ret .= "\$cfg['$var_name']['$k'] = " + . var_export($v, true) . ';' . $crlf; } } return $ret; diff --git a/test/classes/config/PMA_Form_test.php b/test/classes/config/PMA_Form_test.php index dc8caed31e..27e981fc1a 100644 --- a/test/classes/config/PMA_Form_test.php +++ b/test/classes/config/PMA_Form_test.php @@ -38,12 +38,14 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase $GLOBALS['PMA_Config'] = new PMA_Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['server'] = 0; - $this->object = new Form('pma_form_name', array('pma_form1','pma_form2'), new ConfigFile(), 1); + $this->object = new Form( + 'pma_form_name', array('pma_form1','pma_form2'), new ConfigFile(), 1 + ); } /** * tearDown for test cases - * + * * @return void */ protected function tearDown() @@ -53,7 +55,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::__constructor - * + * * @return void */ public function testContructor() @@ -74,7 +76,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::getOptionType - * + * * @return void */ public function testGetOptionType() @@ -98,11 +100,11 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::getOptionValueList - * + * * @return void */ public function testGetOptionValueList() - { + { $this->assertEquals( array('NHibernate C# DO', 'NHibernate XML'), $this->object->getOptionValueList("Export/codegen_format") @@ -110,8 +112,8 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase $this->assertEquals( array( - 'auto' => 'auto', - '1' => 1, + 'auto' => 'auto', + '1' => 1, '0' => 0 ), $this->object->getOptionValueList("OBGzip") @@ -119,8 +121,8 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase $this->assertEquals( array( - 'none' => 'Nowhere', - 'left' => 'Left', + 'none' => 'Nowhere', + 'left' => 'Left', 'right' => 'Right', 'both' => "Both" ), @@ -130,7 +132,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::_readFormPathsCallback - * + * * @return void */ public function testReadFormPathsCallBack() @@ -182,7 +184,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::readFormPaths - * + * * @return void */ public function testReadFormPaths() @@ -228,7 +230,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase preg_match("/^\:group\:end\:(\d+)$/", $key, $matches); $digit = $matches[1]; - + $this->assertEquals( "foo/bar/:group:end:" . $digit, $result[':group:end:' . $digit] @@ -237,7 +239,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::readTypes - * + * * @return void */ public function testReadTypes() @@ -271,7 +273,7 @@ class PMA_Form_Test extends PHPUnit_Framework_TestCase /** * Test for Form::loadForm - * + * * @return void */ public function testLoadForm() diff --git a/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php b/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php index 412da0769f..8d9b2669e1 100644 --- a/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php +++ b/test/classes/plugin/auth/PMA_AuthenticationCookie_test.php @@ -903,7 +903,8 @@ class PMA_AuthenticationCookie_Test extends PHPUnit_Framework_TestCase isset($_COOKIE['pmaServer-2']) ); - // target can be "phpunit" or "ide-phpunut.php", depending on testing environment + // target can be "phpunit" or "ide-phpunut.php", + // depending on testing environment $this->assertStringStartsWith( 'Location: http://phpmyadmin.net/index.php?target=', $GLOBALS['header'][0] diff --git a/test/libraries/PMA_ConfigFile_test.php b/test/libraries/PMA_ConfigFile_test.php index b43f961a11..1220491b88 100644 --- a/test/libraries/PMA_ConfigFile_test.php +++ b/test/libraries/PMA_ConfigFile_test.php @@ -91,7 +91,9 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase ); // Validate default value used in tests - $default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); + $default_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); $this->assertNotNull($default_value); } @@ -103,7 +105,9 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase */ public function testPersistentKeys() { - $default_simple_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); + $default_simple_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); $default_host = $this->object->getDefault('Servers/1/host'); $default_config = array( self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $default_simple_value, @@ -113,14 +117,16 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase /** * Case 1: set default value, key should not be persisted */ - $this->object->set(self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_simple_value); + $this->object->set( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_simple_value + ); $this->object->set('Servers/1/host', $default_host); $this->object->set('Servers/2/host', $default_host); $this->assertEmpty($this->object->getConfig()); /** - * Case 2: persistent keys should be always present in flat array, even if not explicitly set - * (unless they are Server entries) + * Case 2: persistent keys should be always present in flat array, + * even if not explicitly set (unless they are Server entries) */ $this->object->setPersistKeys(array_keys($default_config)); $this->object->resetConfigData(); @@ -131,7 +137,8 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase ); /** - * Case 3: persistent keys should be always saved, even if set to default values + * Case 3: persistent keys should be always saved, + * even if set to default values */ $this->object->set('Servers/2/host', $default_host); $this->assertEquals( @@ -182,9 +189,12 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase */ public function testConfigReadMapping() { - $this->object->setCfgUpdateReadMapping(array( + $this->object->setCfgUpdateReadMapping( + array( 'Servers/value1' => 'Servers/1/value1', - 'Servers/value2' => 'Servers/1/value2')); + 'Servers/value2' => 'Servers/1/value2' + ) + ); $this->object->set('Servers/1/passthrough1', 1); $this->object->set('Servers/1/passthrough2', 2); $this->object->updateWithGlobalConfig(array('Servers/value1' => 3)); @@ -290,7 +300,9 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase */ public function testConfigFileSetInSetup() { - $default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); + $default_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); // default values are not written $this->object->set(self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_value); @@ -305,17 +317,23 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase */ public function testConfigFileSetInUserPreferences() { - $default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); + $default_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); // values are not written when they are the same as in config.inc.php - $this->object = new ConfigFile(array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $default_value)); + $this->object = new ConfigFile( + array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $default_value) + ); $this->object->set(self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_value); $this->assertEmpty($this->object->getConfig()); - // but if config.inc.php differs from config.default.php, allow to overwrite with - // value from config.default.php + // but if config.inc.php differs from config.default.php, + // allow to overwrite with value from config.default.php $config_inc_php_value = $default_value . 'suffix'; - $this->object = new ConfigFile(array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $config_inc_php_value)); + $this->object = new ConfigFile( + array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $config_inc_php_value) + ); $this->object->set(self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_value); $this->assertEquals( array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $default_value), @@ -333,11 +351,17 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase { $flat_default_config = $this->object->getFlatDefaultConfig(); - $default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); - $this->assertEquals($default_value, $flat_default_config[self::SIMPLE_KEY_WITH_DEFAULT_VALUE]); + $default_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); + $this->assertEquals( + $default_value, $flat_default_config[self::SIMPLE_KEY_WITH_DEFAULT_VALUE] + ); $localhost_value = $this->object->getDefault('Servers/1/host'); - $this->assertEquals($localhost_value, $flat_default_config['Servers/1/host']); + $this->assertEquals( + $localhost_value, $flat_default_config['Servers/1/host'] + ); $cfg = array(); include './libraries/config.default.php'; @@ -398,11 +422,13 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase $this->assertEquals( $cfg_db['Servers'][1]['port'], - $this->object->getDbEntry('Servers/1/port')); + $this->object->getDbEntry('Servers/1/port') + ); $this->assertNull($this->object->getDbEntry('no such key')); $this->assertEquals( array(1), - $this->object->getDbEntry('no such key', array(1))); + $this->object->getDbEntry('no such key', array(1)) + ); } /** @@ -476,37 +502,41 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase $this->object->getServerDSN(1) ); - $this->object->updateWithGlobalConfig(array( - 'Servers' => array( - 1 => array( - "extension" => "mysqli", - "auth_type" => "config", - "user" => "testUser", - "connect_type" => "tcp", - "host" => "example.com", - "port" => "21" + $this->object->updateWithGlobalConfig( + array( + 'Servers' => array( + 1 => array( + "extension" => "mysqli", + "auth_type" => "config", + "user" => "testUser", + "connect_type" => "tcp", + "host" => "example.com", + "port" => "21" + ) ) ) - )); + ); $this->assertEquals( "mysqli://testUser:***@example.com:21", $this->object->getServerDSN(1) ); - $this->object->updateWithGlobalConfig(array( - 'Servers' => array( - 1 => array( - "extension" => "mysql", - "auth_type" => "config", - "user" => "testUser", - "connect_type" => "socket", - "host" => "example.com", - "port" => "21", - "nopassword" => "yes", - "socket" => "123" + $this->object->updateWithGlobalConfig( + array( + 'Servers' => array( + 1 => array( + "extension" => "mysql", + "auth_type" => "config", + "user" => "testUser", + "connect_type" => "socket", + "host" => "example.com", + "port" => "21", + "nopassword" => "yes", + "socket" => "123" + ) ) ) - )); + ); $this->assertEquals( "mysql://testUser@123", $this->object->getServerDSN(1) @@ -560,7 +590,9 @@ class PMA_ConfigFile_Test extends PHPUnit_Framework_TestCase { $this->object->setPersistKeys(array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE)); $this->object->set('Array/test', array('x', 'y')); - $default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); + $default_value = $this->object->getDefault( + self::SIMPLE_KEY_WITH_DEFAULT_VALUE + ); $this->assertEquals( array( diff --git a/test/libraries/PMA_SetupIndex_test.php b/test/libraries/PMA_SetupIndex_test.php index d0eb64b2c0..73777561cf 100644 --- a/test/libraries/PMA_SetupIndex_test.php +++ b/test/libraries/PMA_SetupIndex_test.php @@ -9,8 +9,8 @@ /* * Include to test */ -include_once 'libraries/php-gettext/gettext.inc'; -include_once 'libraries/sanitizing.lib.php'; +require_once 'libraries/php-gettext/gettext.inc'; +require_once 'libraries/sanitizing.lib.php'; require_once 'libraries/config/config_functions.lib.php'; require_once 'libraries/config/ConfigFile.class.php'; require_once 'libraries/core.lib.php'; From f311c9c502ea64a9ea92db12a25b2c8f34c9e887 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sun, 3 Nov 2013 19:13:23 +0530 Subject: [PATCH 2/5] Remove trailing white spaces --- test/classes/PMA_Advisor_test.php | 6 +- test/classes/PMA_DBQbe_test.php | 2 +- test/classes/PMA_File_test.php | 16 +-- test/classes/PMA_List_Database_test.php | 10 +- test/classes/PMA_Message_test.php | 8 +- test/classes/PMA_PDF_test.php | 8 +- test/classes/PMA_Scripts_test.php | 4 +- test/classes/PMA_Table_test.php | 10 +- test/classes/PMA_Theme_Manager_test.php | 8 +- test/classes/PMA_Theme_test.php | 32 +++--- test/classes/PMA_Types_Drizzle_test.php | 12 +-- test/classes/dbi/DBIDrizzle_test.php | 2 +- test/classes/dbi/DBIMysql_test.php | 6 +- .../navigation/PMA_NodeFactory_test.php | 12 +-- .../PMA_Node_Column_Container_test.php | 4 +- .../navigation/PMA_Node_Column_test.php | 4 +- .../PMA_Node_Event_Container_test.php | 4 +- .../navigation/PMA_Node_Event_test.php | 4 +- .../PMA_Node_Function_Container_test.php | 4 +- .../navigation/PMA_Node_Function_test.php | 4 +- .../PMA_Node_Index_Container_test.php | 4 +- .../navigation/PMA_Node_Index_test.php | 4 +- .../PMA_Node_Procedure_Container_test.php | 4 +- .../navigation/PMA_Node_Procedure_test.php | 4 +- .../PMA_Node_Trigger_Container_test.php | 2 +- .../navigation/PMA_Node_Trigger_test.php | 2 +- test/classes/navigation/PMA_Node_test.php | 2 +- .../classes/plugin/PMA_PluginManager_test.php | 24 ++--- .../auth/PMA_AuthenticationConfig_test.php | 12 +-- .../auth/PMA_AuthenticationSignon_test.php | 16 +-- .../plugin/export/PMA_ExportExcel_test.php | 14 +-- .../plugin/export/PMA_ExportSql_test.php | 102 +++++++++--------- .../plugin/export/PMA_ExportTexytext_test.php | 44 ++++---- .../plugin/export/PMA_ExportXml_test.php | 36 +++---- .../plugin/export/PMA_ExportYaml_test.php | 16 +-- .../plugin/export/PMA_TableProperty_test.php | 38 +++---- .../plugin/import/ImportMediawiki_test.php | 50 ++++----- test/classes/plugin/import/ImportSql_test.php | 32 +++--- test/classes/plugin/import/ImportXml_test.php | 54 +++++----- .../transformations/Image_PNG_Inline_test.php | 2 +- .../Text_Plain_Append_test.php | 30 +++--- .../Text_Plain_Dateformat_test.php | 2 +- .../Text_Plain_External_test.php | 14 +-- .../Text_Plain_Imagelink_test.php | 2 +- .../Text_Plain_Longtoipv4_test.php | 30 +++--- .../Text_Plain_Substring_test.php | 20 ++-- .../properties/PMA_PorpertyItem_test.php | 6 +- .../options/PMA_OptionsPropertyGroup_test.php | 14 +-- .../options/PMA_OptionsPropertyItem_test.php | 12 +-- .../PMA_OptionsPropertyOneItem_test.php | 14 +-- .../PMA_OptionsPropertyMainGroup_test.php | 6 +- .../PMA_OptionsPropertyRootGroup_test.php | 6 +- .../PMA_OptionsPropertySubgroup_test.php | 10 +- .../options/items/PMA_PropertyItems_test.php | 14 +-- .../PMA_ExportPluginProperties_test.php | 10 +- .../PMA_ImportPluginProperties_test.php | 14 +-- .../plugins/PMA_PluginPorpertyItem_test.php | 6 +- .../schema/Dia_Relation_Schema_test.php | 40 +++---- .../schema/Eps_Relation_Schema_test.php | 42 ++++---- .../schema/Pdf_Relation_Schema_test.php | 60 +++++------ .../schema/Svg_Relation_Schema_test.php | 40 +++---- test/classes/schema/Svg_test.php | 4 +- test/classes/schema/User_Schema_test.php | 48 ++++----- 63 files changed, 533 insertions(+), 533 deletions(-) diff --git a/test/classes/PMA_Advisor_test.php b/test/classes/PMA_Advisor_test.php index c8464d6669..2c82ba35df 100644 --- a/test/classes/PMA_Advisor_test.php +++ b/test/classes/PMA_Advisor_test.php @@ -87,10 +87,10 @@ class Advisor_Test extends PHPUnit_Framework_TestCase { $result = ADVISOR_bytime(10, 2); $this->assertEquals("10 per second", $result); - + $result = ADVISOR_bytime(0.02, 2); $this->assertEquals("1.2 per minute", $result); - + $result = ADVISOR_bytime(0.003, 2); $this->assertEquals("10.8 per hour", $result); } @@ -104,7 +104,7 @@ class Advisor_Test extends PHPUnit_Framework_TestCase { $result = ADVISOR_timespanFormat(1200); $this->assertEquals("0 days, 0 hours, 20 minutes and 0 seconds", $result); - + $result = ADVISOR_timespanFormat(100); $this->assertEquals("0 days, 0 hours, 1 minutes and 40 seconds", $result); } diff --git a/test/classes/PMA_DBQbe_test.php b/test/classes/PMA_DBQbe_test.php index b4a27e51af..d166f91837 100644 --- a/test/classes/PMA_DBQbe_test.php +++ b/test/classes/PMA_DBQbe_test.php @@ -19,7 +19,7 @@ require_once 'libraries/relation.lib.php'; /** * Tests for PMA_DBQbe class - * + * * @package PhpMyAdmin-test */ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase diff --git a/test/classes/PMA_File_test.php b/test/classes/PMA_File_test.php index ba924339ed..0fa52a58a4 100644 --- a/test/classes/PMA_File_test.php +++ b/test/classes/PMA_File_test.php @@ -21,7 +21,7 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase { /** * Setup function for test cases - * + * * @return void */ public function setup() @@ -34,10 +34,10 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_File::getCompression - * + * * @param string $file file string * @param string $mime expected mime - * + * * @return void * @dataProvider compressedFiles */ @@ -49,10 +49,10 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_File::getNextChunk - * + * * @param string $file file string * @param string $mime expected mime - * + * * @return void * @dataProvider compressedFiles */ @@ -71,10 +71,10 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_File::getContent - * + * * @param string $file file string * @param string $mime expected mime - * + * * @return void * @dataProvider compressedFiles */ @@ -87,7 +87,7 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase /** * Data provider for tests - * + * * @return array Test data */ public function compressedFiles() diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index 984069561e..2fa6f2b12b 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -22,7 +22,7 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -49,7 +49,7 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_List_Database::getEmpty - * + * * @return void */ public function testEmpty() @@ -60,7 +60,7 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_List_Database::getSingleItem - * + * * @return void */ public function testSingle() @@ -71,7 +71,7 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_List_Database::exists - * + * * @return void */ public function testExists() @@ -82,7 +82,7 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_List_Database::getHtmlOptions - * + * * @return void */ public function testHtmlOptions() diff --git a/test/classes/PMA_Message_test.php b/test/classes/PMA_Message_test.php index 735c5b178c..2902613663 100644 --- a/test/classes/PMA_Message_test.php +++ b/test/classes/PMA_Message_test.php @@ -330,7 +330,7 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase /** * Data provider for testDecodeBB - * + * * @return array Test data */ public function decodeBBDataProvider() @@ -558,7 +558,7 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase /** * Data provider for testAffectedRows - * + * * @return array Test-data */ public function providerAffectedRows() @@ -603,7 +603,7 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase /** * Data provider for testInsertedRows - * + * * @return array Test-data */ public function providerInsertedRows() @@ -648,7 +648,7 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase /** * Data provider for testDeletedRows - * + * * @return array Test-data */ public function providerDeletedRows() diff --git a/test/classes/PMA_PDF_test.php b/test/classes/PMA_PDF_test.php index a839e868b2..794c67af78 100644 --- a/test/classes/PMA_PDF_test.php +++ b/test/classes/PMA_PDF_test.php @@ -24,7 +24,7 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -35,7 +35,7 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_PDF::getPDFData - * + * * @group large * @return void */ @@ -47,7 +47,7 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_PDF::getPDFData - * + * * @group large * @return void */ @@ -60,7 +60,7 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_PDF::getPDFData - * + * * @group large * @return void */ diff --git a/test/classes/PMA_Scripts_test.php b/test/classes/PMA_Scripts_test.php index 5040670548..d59b8a83a1 100644 --- a/test/classes/PMA_Scripts_test.php +++ b/test/classes/PMA_Scripts_test.php @@ -146,8 +146,8 @@ $(function() {}); public function testGetFiles() { // codemirror's onload event is blacklisted - $this->object->addFile('codemirror/lib/codemirror.js'); - + $this->object->addFile('codemirror/lib/codemirror.js'); + $this->object->addFile('common.js'); $this->assertEquals( array( diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index 17d83da61c..e0bc8f15c1 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -494,7 +494,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $field_primary, $move_to ); $this->assertEquals( - "`PMA_name` BIT(12) PMA_attribute NULL DEFAULT b'10' " + "`PMA_name` BIT(12) PMA_attribute NULL DEFAULT b'10' " . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query ); @@ -507,7 +507,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $field_primary, $move_to ); $this->assertEquals( - "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT TRUE " + "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT TRUE " . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query ); @@ -520,7 +520,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $field_primary, $move_to ); $this->assertEquals( - "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT NULL " + "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT NULL " . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query ); @@ -533,7 +533,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $field_primary, $move_to ); $this->assertEquals( - "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP " + "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP " . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query ); @@ -548,7 +548,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $field_primary, $move_to ); $this->assertEquals( - "`PMA_name` BOOLEAN PMA_attribute NULL INCREMENT " + "`PMA_name` BOOLEAN PMA_attribute NULL INCREMENT " . "COMMENT 'PMA_comment' FIRST", $query ); diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index 0fbffa4cdb..6d4042acf5 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -26,7 +26,7 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -42,7 +42,7 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme_Manager::getThemeCookieName - * + * * @return void */ public function testCookieName() @@ -53,7 +53,7 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme_Manager::getThemeCookieName - * + * * @return void */ public function testPerServerCookieName() @@ -65,7 +65,7 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme_Manager::getHtmlSelectBox - * + * * @return void */ public function testHtmlSelectBox() diff --git a/test/classes/PMA_Theme_test.php b/test/classes/PMA_Theme_test.php index d586035ce2..8a92bc57b2 100644 --- a/test/classes/PMA_Theme_test.php +++ b/test/classes/PMA_Theme_test.php @@ -55,7 +55,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::loadInfo - * + * * @return void */ public function testCheckImgPathNotExisted() @@ -66,7 +66,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::loadInfo - * + * * @return void */ public function testCheckImgPathIncorrect() @@ -80,7 +80,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::getName, getVersion - * + * * @return void */ public function testCheckImgPathFull() @@ -93,7 +93,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::loadInfo - * + * * @return void */ public function testLoadInfo() @@ -115,7 +115,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::load - * + * * @return void */ public function testLoad() @@ -126,7 +126,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::load - * + * * @return void */ public function testLoadNotExisted() @@ -136,7 +136,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test fir PMA_Theme::checkImgPath - * + * * @return void * @expectedException PHPUnit_Framework_Error */ @@ -150,7 +150,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::checkImgPath - * + * * @return void */ public function testCheckImgPath() @@ -161,7 +161,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::checkImgPath - * + * * @return void */ public function testCheckImgPathGlobals() @@ -173,7 +173,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::checkImgPath - * + * * @return void * @expectedException PHPUnit_Framework_Error */ @@ -190,7 +190,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::getPath - * + * * @return void * * @covers PMA_Theme::setPath @@ -206,7 +206,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::loadInfo - * + * * @return void */ public function testGetLayoutFile() @@ -216,7 +216,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::checkVersion - * + * * @return void * * @depends testLoadInfo @@ -238,7 +238,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::getName - * + * * @return void * * @covers PMA_Theme::getName @@ -254,7 +254,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::getId - * + * * @return void * * @covers PMA_Theme::getId @@ -270,7 +270,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase /** * Test for PMA_Theme::getImgPath - * + * * @return void * * @covers PMA_Theme::getImgPath diff --git a/test/classes/PMA_Types_Drizzle_test.php b/test/classes/PMA_Types_Drizzle_test.php index 9b804444a7..c973912672 100644 --- a/test/classes/PMA_Types_Drizzle_test.php +++ b/test/classes/PMA_Types_Drizzle_test.php @@ -29,7 +29,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. - * + * * @return void */ protected function setUp() @@ -56,7 +56,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Provider for testGetTypeDescription - * + * * @return array */ public function providerForTestGetTypeDescription() @@ -162,7 +162,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Data provider - * + * * @return array Test-data */ public function providerFortTestGetTypeClass() @@ -211,7 +211,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Provider for testGetFunctionsClass - * + * * @return array */ public function providerFortTestGetFunctionsClass() @@ -332,7 +332,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Test for getAttributes - * + * * @return void */ public function testGetAttributes() @@ -348,7 +348,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase /** * Test for getColumns - * + * * @return void */ public function testGetColumns() diff --git a/test/classes/dbi/DBIDrizzle_test.php b/test/classes/dbi/DBIDrizzle_test.php index 8894ec72a2..f16ace8a7a 100644 --- a/test/classes/dbi/DBIDrizzle_test.php +++ b/test/classes/dbi/DBIDrizzle_test.php @@ -284,7 +284,7 @@ class PMA_DBI_Drizzle_Test extends PHPUnit_Framework_TestCase "numColumns", $this->object->numFields($result) ); - + } } diff --git a/test/classes/dbi/DBIMysql_test.php b/test/classes/dbi/DBIMysql_test.php index 556edd6d17..6da2d202cd 100644 --- a/test/classes/dbi/DBIMysql_test.php +++ b/test/classes/dbi/DBIMysql_test.php @@ -139,15 +139,15 @@ class PMA_DBI_Mysql_Test extends PHPUnit_Framework_TestCase 'mysql_fetch_array', $ret ); - + //test for affectedRows $link = "PMA_link"; - $get_from_cache = false; + $get_from_cache = false; $ret = $this->object->affectedRows($link, $get_from_cache); $this->assertEquals( "mysql_affected_rows", $ret - ); + ); //test for connect $user = 'PMA_user'; diff --git a/test/classes/navigation/PMA_NodeFactory_test.php b/test/classes/navigation/PMA_NodeFactory_test.php index f7ed29e972..44a525259e 100644 --- a/test/classes/navigation/PMA_NodeFactory_test.php +++ b/test/classes/navigation/PMA_NodeFactory_test.php @@ -20,7 +20,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -32,7 +32,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testDefaultNode() @@ -45,7 +45,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testDefaultContainer() @@ -58,7 +58,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testGroupContainer() @@ -73,7 +73,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testFileError() @@ -84,7 +84,7 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testClassNameError() diff --git a/test/classes/navigation/PMA_Node_Column_Container_test.php b/test/classes/navigation/PMA_Node_Column_Container_test.php index 71f731bcfd..372c9d2c05 100644 --- a/test/classes/navigation/PMA_Node_Column_Container_test.php +++ b/test/classes/navigation/PMA_Node_Column_Container_test.php @@ -19,7 +19,7 @@ class Node_Column_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Column_Container_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::__construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Column_test.php b/test/classes/navigation/PMA_Node_Column_test.php index d2d08159a6..fe58dfa01b 100644 --- a/test/classes/navigation/PMA_Node_Column_test.php +++ b/test/classes/navigation/PMA_Node_Column_test.php @@ -19,7 +19,7 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase /** * Test for PMA_NodeFactory::getInstance - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Event_Container_test.php b/test/classes/navigation/PMA_Node_Event_Container_test.php index 0ae76cb120..818daa6047 100644 --- a/test/classes/navigation/PMA_Node_Event_Container_test.php +++ b/test/classes/navigation/PMA_Node_Event_Container_test.php @@ -19,7 +19,7 @@ class Node_Event_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Event_Container_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Event_test.php b/test/classes/navigation/PMA_Node_Event_test.php index ff89cc688b..87c888768d 100644 --- a/test/classes/navigation/PMA_Node_Event_test.php +++ b/test/classes/navigation/PMA_Node_Event_test.php @@ -19,7 +19,7 @@ class Node_Event_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Event_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Function_Container_test.php b/test/classes/navigation/PMA_Node_Function_Container_test.php index eeec930968..a2b5444597 100644 --- a/test/classes/navigation/PMA_Node_Function_Container_test.php +++ b/test/classes/navigation/PMA_Node_Function_Container_test.php @@ -19,7 +19,7 @@ class Node_Function_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Function_Container_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Function_test.php b/test/classes/navigation/PMA_Node_Function_test.php index 95221a18ec..a374bcba5e 100644 --- a/test/classes/navigation/PMA_Node_Function_test.php +++ b/test/classes/navigation/PMA_Node_Function_test.php @@ -19,7 +19,7 @@ class Node_Function_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Function_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Index_Container_test.php b/test/classes/navigation/PMA_Node_Index_Container_test.php index 73529ad30f..a1bbf57c6b 100644 --- a/test/classes/navigation/PMA_Node_Index_Container_test.php +++ b/test/classes/navigation/PMA_Node_Index_Container_test.php @@ -19,7 +19,7 @@ class Node_Index_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Index_Container_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Index_test.php b/test/classes/navigation/PMA_Node_Index_test.php index bce85e9158..ca2d0017bd 100644 --- a/test/classes/navigation/PMA_Node_Index_test.php +++ b/test/classes/navigation/PMA_Node_Index_test.php @@ -19,7 +19,7 @@ class Node_Index_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Index_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Procedure_Container_test.php b/test/classes/navigation/PMA_Node_Procedure_Container_test.php index 59e671a7e8..49278b6fb8 100644 --- a/test/classes/navigation/PMA_Node_Procedure_Container_test.php +++ b/test/classes/navigation/PMA_Node_Procedure_Container_test.php @@ -19,7 +19,7 @@ class Node_Procedure_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Procedure_Container_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Procedure_test.php b/test/classes/navigation/PMA_Node_Procedure_test.php index fc35a931e0..f394d77938 100644 --- a/test/classes/navigation/PMA_Node_Procedure_test.php +++ b/test/classes/navigation/PMA_Node_Procedure_test.php @@ -19,7 +19,7 @@ class Node_Procedure_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -31,7 +31,7 @@ class Node_Procedure_Test extends PHPUnit_Framework_TestCase /** * Test for __construct - * + * * @return void */ public function testConstructor() diff --git a/test/classes/navigation/PMA_Node_Trigger_Container_test.php b/test/classes/navigation/PMA_Node_Trigger_Container_test.php index d62599caa7..281f93f177 100644 --- a/test/classes/navigation/PMA_Node_Trigger_Container_test.php +++ b/test/classes/navigation/PMA_Node_Trigger_Container_test.php @@ -19,7 +19,7 @@ class Node_Trigger_Container_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() diff --git a/test/classes/navigation/PMA_Node_Trigger_test.php b/test/classes/navigation/PMA_Node_Trigger_test.php index a76c96cffe..de24ee11a9 100644 --- a/test/classes/navigation/PMA_Node_Trigger_test.php +++ b/test/classes/navigation/PMA_Node_Trigger_test.php @@ -19,7 +19,7 @@ class Node_Trigger_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() diff --git a/test/classes/navigation/PMA_Node_test.php b/test/classes/navigation/PMA_Node_test.php index 63007dc796..d75866e59d 100644 --- a/test/classes/navigation/PMA_Node_test.php +++ b/test/classes/navigation/PMA_Node_test.php @@ -20,7 +20,7 @@ class Node_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() diff --git a/test/classes/plugin/PMA_PluginManager_test.php b/test/classes/plugin/PMA_PluginManager_test.php index e39c7f1789..817ce576d3 100644 --- a/test/classes/plugin/PMA_PluginManager_test.php +++ b/test/classes/plugin/PMA_PluginManager_test.php @@ -13,16 +13,16 @@ require_once 'libraries/config.default.php'; /** * Dummy testObserver - * + * * @package PhpMyAdmin-test */ class PMA_TestObserver implements SplObserver { /** * udpate - * + * * @param SplSubject $subject subject for observer - * + * * @return null */ public function update(SplSubject $subject) @@ -51,16 +51,16 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase $GLOBALS['PMA_Config'] = new PMA_Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['server'] = 0; - + $this->object = new PluginManager(null); - + $this->attrStorage = new \ReflectionProperty('PluginManager', '_storage'); $this->attrStorage->setAccessible(true); } /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -70,7 +70,7 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase /** * Test for PluginManager::__construct - * + * * @return void */ public function testConstructor() @@ -83,7 +83,7 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase /** * Test for PluginManager::attach - * + * * @return void */ public function testAttach() @@ -107,7 +107,7 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase /** * Test for PluginManager::detach - * + * * @return void */ public function testDetach() @@ -132,13 +132,13 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase * Test for * - PluginManager::getStorage * - PluginManager::setStorage - * + * * @return void */ public function testSetGetStorage() { $s = new SplObjectStorage(); - $o1 = new StdClass; + $o1 = new StdClass; $s[$o1] = 'testData'; $this->object->setStorage($s); @@ -153,7 +153,7 @@ class PMA_PluginManager_Test extends PHPUnit_Framework_TestCase * Test for * - PluginManager::getStatus * - PluginManager::setStatus - * + * * @return void */ public function testSetGetStatus() diff --git a/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php b/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php index fe40806f77..32f980e2c6 100644 --- a/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php +++ b/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php @@ -37,7 +37,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -47,7 +47,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationConfig::auth - * + * * @return void */ public function testAuth() @@ -59,7 +59,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationConfig::authCheck - * + * * @return void */ public function testAuthCheck() @@ -71,7 +71,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationConfig::authSetUser - * + * * @return void */ public function testAuthSetUser() @@ -83,7 +83,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationConfig::authFails - * + * * @return void */ public function testAuthFails() @@ -94,7 +94,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase $GLOBALS['allowDeny_forbidden'] = false; if (!defined('PMA_USR_BROWSER_AGENT')) { define('PMA_USR_BROWSER_AGENT', 'chrome'); - + $removeConstant = true; if (! PMA_HAS_RUNKIT) { diff --git a/test/classes/plugin/auth/PMA_AuthenticationSignon_test.php b/test/classes/plugin/auth/PMA_AuthenticationSignon_test.php index 78e28f4acb..e7df0a1479 100644 --- a/test/classes/plugin/auth/PMA_AuthenticationSignon_test.php +++ b/test/classes/plugin/auth/PMA_AuthenticationSignon_test.php @@ -39,7 +39,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -49,7 +49,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationSignon::auth - * + * * @return void */ public function testAuth() @@ -103,7 +103,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationSignon::authCheck - * + * * @return void */ public function testAuthCheck() @@ -125,7 +125,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['Server']['host'] = 'localhost'; $GLOBALS['cfg']['Server']['port'] = '80'; $GLOBALS['cfg']['Server']['user'] = 'user'; - + $this->assertTrue( $this->object->authCheck() ); @@ -215,7 +215,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationSignon::authSetUser - * + * * @return void */ public function testAuthSetUser() @@ -240,7 +240,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase /** * Test for AuthenticationSignon::authFails - * + * * @return void */ public function testAuthFails() @@ -259,7 +259,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase // case 1 $GLOBALS['login_without_password_is_forbidden'] = true; - + $this->object->authFails(); $this->assertEquals( @@ -272,7 +272,7 @@ class PMA_AuthenticationSignon_Test extends PHPUnit_Framework_TestCase $GLOBALS['login_without_password_is_forbidden'] = null; $GLOBALS['allowDeny_forbidden'] = true; - + $this->object->authFails(); $this->assertEquals( diff --git a/test/classes/plugin/export/PMA_ExportExcel_test.php b/test/classes/plugin/export/PMA_ExportExcel_test.php index 48c4b7e06b..a77a8d7587 100644 --- a/test/classes/plugin/export/PMA_ExportExcel_test.php +++ b/test/classes/plugin/export/PMA_ExportExcel_test.php @@ -34,7 +34,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -44,7 +44,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase /** * Test for ExportExcel::setProperties - * + * * @return void */ public function testSetProperties() @@ -115,7 +115,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase 'TextPropertyItem', $property ); - + $this->assertEquals( 'null', $property->getName() @@ -132,7 +132,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase 'BoolPropertyItem', $property ); - + $this->assertEquals( 'removeCRLF', $property->getName() @@ -149,7 +149,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase 'BoolPropertyItem', $property ); - + $this->assertEquals( 'columns', $property->getName() @@ -166,7 +166,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase 'SelectPropertyItem', $property ); - + $this->assertEquals( 'edition', $property->getName() @@ -192,7 +192,7 @@ class PMA_ExportExcel_Test extends PHPUnit_Framework_TestCase 'HiddenPropertyItem', $property ); - + $this->assertEquals( 'structure_or_data', $property->getName() diff --git a/test/classes/plugin/export/PMA_ExportSql_test.php b/test/classes/plugin/export/PMA_ExportSql_test.php index 448f7c7d84..07fc75f47f 100644 --- a/test/classes/plugin/export/PMA_ExportSql_test.php +++ b/test/classes/plugin/export/PMA_ExportSql_test.php @@ -42,7 +42,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -52,7 +52,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::setProperties - * + * * @return void */ public function testSetProperties() @@ -71,7 +71,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase } if (PMA_MYSQL_INT_VERSION <= 50100) { $restoreMySQLIntVersion = PMA_MYSQL_INT_VERSION; - runkit_constant_redefine('PMA_MYSQL_INT_VERSION', 50111); + runkit_constant_redefine('PMA_MYSQL_INT_VERSION', 50111); } } } @@ -261,7 +261,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase ); $this->assertEquals( - 'Add DROP TABLE / VIEW / PROCEDURE / FUNCTION' . + 'Add DROP TABLE / VIEW / PROCEDURE / FUNCTION' . ' / EVENT statement', $leaf->getText() ); @@ -326,13 +326,13 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::setProperties - * + * * @return void */ public function testSetPropertiesWithDrizzle() { $restoreDrizzle = $restoreMySQLIntVersion = 'PMANORESTORE'; - + if (!PMA_DRIZZLE || PMA_MYSQL_INT_VERSION > 50100) { if (!PMA_HAS_RUNKIT) { $this->markTestSkipped( @@ -345,7 +345,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase } if (PMA_MYSQL_INT_VERSION > 50100) { $restoreMySQLIntVersion = PMA_MYSQL_INT_VERSION; - runkit_constant_redefine('PMA_MYSQL_INT_VERSION', 50000); + runkit_constant_redefine('PMA_MYSQL_INT_VERSION', 50000); } } } @@ -364,9 +364,9 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase $properties = $attrProperties->getValue($this->object); $options = $properties->getOptions(); - + $generalOptionsArray = $options->getProperties(); - + $this->assertCount( 3, $generalOptionsArray @@ -435,7 +435,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase $structOption = $generalOptionsArray[1]; $properties = $structOption->getProperties(); $subgroupProps = $properties[0]->getProperties(); - + $this->assertContains( 'DROP TABLE', $subgroupProps[0]->getText() @@ -454,7 +454,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportRoutines - * + * * @return void */ public function testExportRoutines() @@ -504,14 +504,14 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::_exportComment - * + * * @return void */ public function testExportComment() { $method = new ReflectionMethod('ExportSql', '_exportComment'); $method->setAccessible(true); - + $GLOBALS['crlf'] = '##'; $GLOBALS['sql_include_comments'] = true; @@ -526,7 +526,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase ); $GLOBALS['sql_include_comments'] = false; - + $this->assertEquals( '', $method->invoke($this->object, 'Comment') @@ -542,14 +542,14 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::_possibleCRLF - * + * * @return void */ public function testPossibleCRLF() { $method = new ReflectionMethod('ExportSql', '_possibleCRLF'); $method->setAccessible(true); - + $GLOBALS['crlf'] = '##'; $GLOBALS['sql_include_comments'] = true; @@ -564,7 +564,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase ); $GLOBALS['sql_include_comments'] = false; - + $this->assertEquals( '', $method->invoke($this->object, 'Comment') @@ -580,7 +580,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportFooter - * + * * @return void */ public function testExportFooter() @@ -614,7 +614,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->once()) ->method('query') ->with('SET time_zone = "GMT"'); - + $GLOBALS['dbi'] = $dbi; $this->expectOutputString( @@ -636,7 +636,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportHeader - * + * * @return void */ public function testExportHeader() @@ -686,7 +686,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->once()) ->method('query') ->with('SET time_zone = "+00:00"'); - + $GLOBALS['dbi'] = $dbi; ob_start(); @@ -704,12 +704,12 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase 'h2C', $result ); - + $this->assertContains( "SET FOREIGN_KEY_CHECKS=0;\n", $result ); - + $this->assertContains( "40101 SET", $result @@ -719,7 +719,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase "SET FOREIGN_KEY_CHECKS=0;\n" . "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\n" . "SET AUTOCOMMIT = 0;\n" . - "START TRANSACTION;\n" . + "START TRANSACTION;\n" . "SET time_zone = \"+00:00\";\n", $result ); @@ -732,7 +732,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportDBCreate - * + * * @return void */ public function testExportDBCreate() @@ -816,7 +816,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportDBHeader - * + * * @return void */ public function testExportDBHeader() @@ -825,7 +825,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase $GLOBALS['sql_backquotes'] = ''; $GLOBALS['sql_include_comments'] = true; $GLOBALS['crlf'] = "\n"; - + ob_start(); $this->assertTrue( $this->object->exportDBHeader('testDB') @@ -840,7 +840,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase // case 2 unset($GLOBALS['sql_compatibility']); unset($GLOBALS['sql_backquotes']); - + ob_start(); $this->assertTrue( $this->object->exportDBHeader('testDB') @@ -855,7 +855,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportDBFooter - * + * * @return void */ public function testExportDBFooterWithNewerMySQLVersion() @@ -940,7 +940,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportDBFooter - * + * * @return void */ public function testExportDBFooterWithOlderMySQLVersion() @@ -987,7 +987,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::getTableDefStandIn - * + * * @return void */ public function testGetTableDefStandIn() @@ -1025,7 +1025,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::_getTableDefForView - * + * * @return void */ public function testGetTableDefForView() @@ -1105,7 +1105,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::getTableDef - * + * * @return void */ public function testGetTableDefWithoutDrizzle() @@ -1189,7 +1189,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase "CREATE TABLE `db`.`table`,\n CONSTRAINT KEYS \nFOREIGN KEY\n) " . "unsigned NOT NULL\n(\r\n" ); - + $dbi->expects($this->once()) ->method('fetchRow') ->with('res') @@ -1241,7 +1241,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase '-- Constraints for table "table"', $GLOBALS['sql_constraints'] ); - + $this->assertContains( 'ALTER TABLE "table"' . "\n", $GLOBALS['sql_constraints'] @@ -1271,7 +1271,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase 'ALTER TABLE "db"."table"' . "\n", $GLOBALS['sql_drop_foreign_keys'] ); - + $this->assertContains( 'DROP FOREIGN KEY KEYS', $GLOBALS['sql_drop_foreign_keys'] @@ -1284,7 +1284,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::getTableDef - * + * * @return void */ public function testGetTableDefWithDrizzle() @@ -1366,7 +1366,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase "CREATE TABLE `db`.`table` ROW_FORMAT='row',\n CONSTRAINT " . "KEYS \nFOREIGN KEY\n) unsigned NOT NULL\n(\r" ); - + $dbi->expects($this->once()) ->method('fetchRow') ->with('res') @@ -1398,7 +1398,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase '-- Constraints for table', $GLOBALS['sql_constraints'] ); - + $this->assertNotContains( '-- Constraints for table "table"', $GLOBALS['sql_constraints'] @@ -1411,7 +1411,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::getTableDef - * + * * @return void */ public function testGetTableDefWithError() @@ -1514,7 +1514,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::_getTableComments - * + * * @return void */ public function testGetTableComments() @@ -1585,12 +1585,12 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportStructure - * + * * @return void */ public function testExportStructure() { - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); @@ -1651,7 +1651,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase 'dumpText1', $result ); - + // case 2 unset($GLOBALS['sql_compatibility']); unset($GLOBALS['sql_backquotes']); @@ -1747,7 +1747,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportData - * + * * @return void */ public function testExportData() @@ -1879,7 +1879,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportData - * + * * @return void */ public function testExportDataWithUpdate() @@ -1973,7 +1973,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportData - * + * * @return void */ public function testExportDataWithIsView() @@ -2011,7 +2011,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::exportData - * + * * @return void */ public function testExportDataWithError() @@ -2044,12 +2044,12 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase /** * Test for ExportSql::_makeCreateTableMSSQLCompatible - * + * * @return void */ public function testMakeCreateTableMSSQLCompatible() { - + $query = "CREATE TABLE IF NOT EXISTS (\" date DEFAULT NULL,\n" . "\" date DEFAULT NULL\n\" date NOT NULL,\n\" date NOT NULL\n," . " \" date NOT NULL DEFAULT 'asd'," . @@ -2066,7 +2066,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase " \" float(22,2,) NOT NULL,\n" . " \" double NOT NULL\n" . " \" double NOT NULL DEFAULT '213'\n"; - + $method = new ReflectionMethod( 'ExportSql', '_makeCreateTableMSSQLCompatible' ); diff --git a/test/classes/plugin/export/PMA_ExportTexytext_test.php b/test/classes/plugin/export/PMA_ExportTexytext_test.php index 733a46ae94..b07ffe9123 100644 --- a/test/classes/plugin/export/PMA_ExportTexytext_test.php +++ b/test/classes/plugin/export/PMA_ExportTexytext_test.php @@ -42,7 +42,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -52,7 +52,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::setProperties - * + * * @return void */ public function testSetProperties() @@ -124,7 +124,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase 'RadioPropertyItem', $property ); - + $generalOptions = array_shift($generalOptionsArray); $this->assertInstanceOf( @@ -145,7 +145,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase 'BoolPropertyItem', $property ); - + $this->assertEquals( 'columns', $property->getName() @@ -157,7 +157,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase 'TextPropertyItem', $property ); - + $this->assertEquals( 'null', $property->getName() @@ -166,7 +166,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportHeader - * + * * @return void */ public function testExportHeader() @@ -178,7 +178,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportFooter - * + * * @return void */ public function testExportFooter() @@ -190,7 +190,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportDBHeader - * + * * @return void */ public function testExportDBHeader() @@ -205,7 +205,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportDBFooter - * + * * @return void */ public function testExportDBFooter() @@ -217,7 +217,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportDBCreate - * + * * @return void */ public function testExportDBCreate() @@ -229,7 +229,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::exportData - * + * * @return void */ public function testExportData() @@ -287,12 +287,12 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase "|&gt;|0|test", $result ); - + } /** * Test for ExportTexytext::getTableDefStandIn - * + * * @return void */ public function testGetTableDefStandIn() @@ -353,7 +353,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::getTableDef - * + * * @return void */ public function testGetTableDef() @@ -419,7 +419,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase ) ); - + $columns = array( 'Field' => 'fname', 'Comment' => 'comm' @@ -429,7 +429,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase ->method('getColumns') ->with('db', 'table') ->will($this->returnValue(array($columns))); - + $GLOBALS['dbi'] = $dbi; $this->object->expects($this->exactly(1)) @@ -465,7 +465,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::getTriggers - * + * * @return void */ public function testGetTriggers() @@ -482,7 +482,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase 'definition' => 'def' ) ); - + $dbi->expects($this->once()) ->method('getTriggers') ->with('database', 'tagetMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); @@ -549,7 +549,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase ->will($this->returnValue('dumpText4')); $GLOBALS['dbi'] = $dbi; - + // case 1 ob_start(); $this->assertTrue( @@ -609,7 +609,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase /** * Test for ExportTexytext::formatOneColumnDefinition - * + * * @return void */ public function testFormatOneColumnDefinition() diff --git a/test/classes/plugin/export/PMA_ExportXml_test.php b/test/classes/plugin/export/PMA_ExportXml_test.php index 822edd042c..c3647bec84 100644 --- a/test/classes/plugin/export/PMA_ExportXml_test.php +++ b/test/classes/plugin/export/PMA_ExportXml_test.php @@ -43,7 +43,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -53,7 +53,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::setProperties - * + * * @return void */ public function testSetProperties() @@ -133,7 +133,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase 'HiddenPropertyItem', $property ); - + $generalOptions = array_shift($generalOptionsArray); $this->assertInstanceOf( @@ -194,7 +194,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase 'data', $generalOptions->getName() ); - + $generalProperties = $generalOptions->getProperties(); $property = array_shift($generalProperties); @@ -203,7 +203,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase 'BoolPropertyItem', $property ); - + if ($restoreDrizzle !== "PMANORESTORE") { runkit_constant_redefine('PMA_DRIZZLE', $restoreDrizzle); } @@ -211,7 +211,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportHeader - * + * * @return void */ public function testExportHeaderWithoutDrizzle() @@ -447,7 +447,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase '<pma:structure_schemas>' . "\n" . ' <pma:database name="d&lt;&quot;b" collat' . 'ion="utf8_general_ci" charset="utf-8">' . "\n" . - ' </pma:database>' . "\n" . + ' </pma:database>' . "\n" . ' </pma:structure_schemas>', $result ); @@ -459,7 +459,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportHeader - * + * * @return void */ public function testExportHeaderWithDrizzle() @@ -521,7 +521,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase ->method('fetchResult') ->will($this->returnValue(false)); - + $GLOBALS['dbi'] = $dbi; $GLOBALS['tables'] = array(); @@ -540,7 +540,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportFooter - * + * * @return void */ public function testExportFooter() @@ -555,7 +555,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportDBHeader - * + * * @return void */ public function testExportDBHeader() @@ -582,7 +582,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportDBFooter - * + * * @return void */ public function testExportDBFooter() @@ -609,7 +609,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportDBCreate - * + * * @return void */ public function testExportDBCreate() @@ -621,7 +621,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportXml::exportData - * + * * @return void */ public function testExportData() @@ -678,23 +678,23 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase "<table name="ta&lt;ble">", $result ); - + $this->assertContains( "<column name="fName1">NULL</column>", $result ); - + $this->assertContains( "<column name="fNa&quot;me2">&lt;a&gt;" . "</column>", $result ); - + $this->assertContains( "<column name="fName3">NULL</column>", $result ); - + $this->assertContains( "</table>", $result diff --git a/test/classes/plugin/export/PMA_ExportYaml_test.php b/test/classes/plugin/export/PMA_ExportYaml_test.php index eeeb75f034..95f8ad2912 100644 --- a/test/classes/plugin/export/PMA_ExportYaml_test.php +++ b/test/classes/plugin/export/PMA_ExportYaml_test.php @@ -40,7 +40,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -50,7 +50,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::setProperties - * + * * @return void */ public function testSetProperties() @@ -121,7 +121,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportHeader - * + * * @return void */ public function testExportHeader() @@ -140,7 +140,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportFooter - * + * * @return void */ public function testExportFooter() @@ -155,7 +155,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportDBHeader - * + * * @return void */ public function testExportDBHeader() @@ -167,7 +167,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportDBFooter - * + * * @return void */ public function testExportDBFooter() @@ -179,7 +179,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportDBCreate - * + * * @return void */ public function testExportDBCreate() @@ -191,7 +191,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase /** * Test for ExportYaml::exportData - * + * * @return void */ public function testExportData() diff --git a/test/classes/plugin/export/PMA_TableProperty_test.php b/test/classes/plugin/export/PMA_TableProperty_test.php index a62441004e..847be701ca 100644 --- a/test/classes/plugin/export/PMA_TableProperty_test.php +++ b/test/classes/plugin/export/PMA_TableProperty_test.php @@ -35,7 +35,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -83,7 +83,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::getPureType - * + * * @return void */ public function testGetPureType() @@ -105,10 +105,10 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::isNotNull - * + * * @param string $nullable nullable value * @param string $expected expected output - * + * * @return void * @dataProvider isNotNullProvider */ @@ -124,7 +124,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Data provider for testIsNotNull - * + * * @return array Test Data */ public function isNotNullProvider() @@ -138,10 +138,10 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::isUnique - * + * * @param string $key key value * @param string $expected expected output - * + * * @return void * @dataProvider isUniqueProvider */ @@ -157,7 +157,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Data provider for testIsUnique - * + * * @return array Test Data */ public function isUniqueProvider() @@ -173,10 +173,10 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::getDotNetPrimitiveType - * + * * @param string $type type value * @param string $expected expected output - * + * * @return void * @dataProvider getDotNetPrimitiveTypeProvider */ @@ -192,7 +192,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Data provider for testGetDotNetPrimitiveType - * + * * @return array Test Data */ public function getDotNetPrimitiveTypeProvider() @@ -214,10 +214,10 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::getDotNetObjectType - * + * * @param string $type type value * @param string $expected expected output - * + * * @return void * @dataProvider getDotNetObjectTypeProvider */ @@ -233,7 +233,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Data provider for testGetDotNetObjectType - * + * * @return array Test Data */ public function getDotNetObjectTypeProvider() @@ -255,7 +255,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::getIndexName - * + * * @return void */ public function testGetIndexName() @@ -278,7 +278,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::isPK - * + * * @return void */ public function testIsPK() @@ -298,7 +298,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::formatCs - * + * * @return void */ public function testFormatCs() @@ -313,7 +313,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::formatXml - * + * * @return void */ public function testFormatXml() @@ -328,7 +328,7 @@ class PMA_TableProperty_Test extends PHPUnit_Framework_TestCase /** * Test for TableProperty::format - * + * * @return void */ public function testFormat() diff --git a/test/classes/plugin/import/ImportMediawiki_test.php b/test/classes/plugin/import/ImportMediawiki_test.php index 2b024b07ed..035dcfd9d9 100644 --- a/test/classes/plugin/import/ImportMediawiki_test.php +++ b/test/classes/plugin/import/ImportMediawiki_test.php @@ -50,17 +50,17 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase $GLOBALS['plugin_param'] = 'database'; $this->object = new ImportMediawiki(); - //setting + //setting $GLOBALS['finished'] = false; $GLOBALS['read_limit'] = 100000000; $GLOBALS['offset'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['cfg']['AllowUserDropDatabase'] = false; - + $GLOBALS['import_file'] = 'test/test_data/phpmyadmin.mediawiki'; $GLOBALS['import_text'] = 'ImportMediawiki_Test'; - $GLOBALS['compression'] = 'none'; + $GLOBALS['compression'] = 'none'; $GLOBALS['read_multiply'] = 10; $GLOBALS['import_type'] = 'Mediawiki'; $GLOBALS['import_handle'] = @fopen($GLOBALS['import_file'], 'r'); @@ -77,7 +77,7 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getProperties * @@ -91,26 +91,26 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase $this->assertEquals( __('MediaWiki Table'), $properties->getText() - ); + ); $this->assertEquals( 'txt', $properties->getExtension() - ); + ); $this->assertEquals( 'text/plain', $properties->getMimeType() - ); + ); $this->assertEquals( array(), $properties->getOptions() - ); + ); $this->assertEquals( __('Options'), $properties->getOptionsText() - ); - + ); + } - + /** * Test for doImport * @@ -121,22 +121,22 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase public function testDoImport() { //$import_notice will show the import detail result - global $import_notice; - + global $import_notice; + //Mock DBI $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); $GLOBALS['dbi'] = $dbi; - + //Test function called $this->object->doImport(); - - // If import successfully, PMA will show all databases and + + // If import successfully, PMA will show all databases and // tables imported as following HTML Page /* - The following structures have either been created or altered. Here you + The following structures have either been created or altered. Here you can: View a structure's contents by clicking on its name Change any of its settings by clicking the corresponding "Options" link @@ -144,25 +144,25 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase mediawiki_DB (Options) pma_bookmarktest (Structure) (Options) - */ - + */ + //asset that all databases and tables are imported $this->assertContains( 'The following structures have either been created or altered.', $import_notice - ); + ); $this->assertContains( 'Go to database: `mediawiki_DB`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `mediawiki_DB`', $import_notice - ); + ); $this->assertContains( 'Go to table: `pma_bookmarktest`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `pma_bookmarktest`', $import_notice @@ -170,7 +170,7 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase $this->assertEquals( true, $GLOBALS['finished'] - ); - + ); + } } diff --git a/test/classes/plugin/import/ImportSql_test.php b/test/classes/plugin/import/ImportSql_test.php index 2d590e744b..3e1da3267d 100644 --- a/test/classes/plugin/import/ImportSql_test.php +++ b/test/classes/plugin/import/ImportSql_test.php @@ -4,7 +4,7 @@ * * @package PhpMyAdmin-test */ - + /* * we must set $GLOBALS['server'] here * since 'check_user_privileges.lib.php' will use it globally @@ -45,20 +45,20 @@ class ImportSql_Test extends PHPUnit_Framework_TestCase * @return void */ protected function setUp() - { - $this->object = new ImportSql(); + { + $this->object = new ImportSql(); - //setting + //setting $GLOBALS['finished'] = false; $GLOBALS['read_limit'] = 100000000; $GLOBALS['offset'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['cfg']['AllowUserDropDatabase'] = false; - + $GLOBALS['import_file'] = 'test/test_data/pma_bookmark.sql'; $GLOBALS['import_text'] = 'ImportSql_Test'; - $GLOBALS['compression'] = 'none'; + $GLOBALS['compression'] = 'none'; $GLOBALS['read_multiply'] = 10; $GLOBALS['import_type'] = 'Xml'; $GLOBALS['import_handle'] = @fopen($GLOBALS['import_file'], 'r'); @@ -75,7 +75,7 @@ class ImportSql_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for doImport * @@ -88,36 +88,36 @@ class ImportSql_Test extends PHPUnit_Framework_TestCase //$sql_query_disabled will show the import SQL detail global $sql_query, $sql_query_disabled; $sql_query_disabled = false; - + //Mock DBI $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); $GLOBALS['dbi'] = $dbi; - + //Test function called $this->object->doImport(); - + //asset that all sql are executed $this->assertContains( 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";', $sql_query - ); + ); $this->assertContains( 'CREATE TABLE IF NOT EXISTS `pma_bookmark`', $sql_query - ); + ); $this->assertContains( 'INSERT INTO `pma_bookmark` (`id`, `dbase`, `user`, `label`, `query`) ' . 'VALUES', $sql_query - ); - + ); + $this->assertEquals( true, $GLOBALS['finished'] - ); - + ); + } } diff --git a/test/classes/plugin/import/ImportXml_test.php b/test/classes/plugin/import/ImportXml_test.php index 1f3d0fa425..4b846c03b5 100644 --- a/test/classes/plugin/import/ImportXml_test.php +++ b/test/classes/plugin/import/ImportXml_test.php @@ -4,7 +4,7 @@ * * @package PhpMyAdmin-test */ - + /* * we must set $GLOBALS['server'] here * since 'check_user_privileges.lib.php' will use it globally @@ -44,21 +44,21 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase * @return void */ protected function setUp() - { - $this->object = new ImportXml(); + { + $this->object = new ImportXml(); - //setting + //setting $GLOBALS['finished'] = false; $GLOBALS['read_limit'] = 100000000; $GLOBALS['offset'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['cfg']['AllowUserDropDatabase'] = false; - + $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_' . 'For_Testing.xml'; $GLOBALS['import_text'] = 'ImportXml_Test'; - $GLOBALS['compression'] = 'none'; + $GLOBALS['compression'] = 'none'; $GLOBALS['read_multiply'] = 10; $GLOBALS['import_type'] = 'Xml'; $GLOBALS['import_handle'] = @fopen($GLOBALS['import_file'], 'r'); @@ -75,7 +75,7 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getProperties * @@ -89,26 +89,26 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase $this->assertEquals( __('XML'), $properties->getText() - ); + ); $this->assertEquals( 'xml', $properties->getExtension() - ); + ); $this->assertEquals( 'text/xml', $properties->getMimeType() - ); + ); $this->assertEquals( array(), $properties->getOptions() - ); + ); $this->assertEquals( __('Options'), $properties->getOptionsText() - ); - + ); + } - + /** * Test for doImport * @@ -119,18 +119,18 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase public function testDoImport() { //$import_notice will show the import detail result - global $import_notice; - + global $import_notice; + //Mock DBI $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); $GLOBALS['dbi'] = $dbi; - + //Test function called $this->object->doImport(); - - // If import successfully, PMA will show all databases and tables + + // If import successfully, PMA will show all databases and tables // imported as following HTML Page /* The following structures have either been created or altered. Here you @@ -141,25 +141,25 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase phpmyadmintest (Options) pma_bookmarktest (Structure) (Options) - */ - + */ + //asset that all databases and tables are imported $this->assertContains( 'The following structures have either been created or altered.', $import_notice - ); + ); $this->assertContains( 'Go to database: `phpmyadmintest`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `phpmyadmintest`', $import_notice - ); + ); $this->assertContains( 'Go to table: `pma_bookmarktest`', $import_notice - ); + ); $this->assertContains( 'Edit settings for `pma_bookmarktest`', $import_notice @@ -167,8 +167,8 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase $this->assertEquals( true, $GLOBALS['finished'] - ); - + ); + } } diff --git a/test/classes/plugin/transformations/Image_PNG_Inline_test.php b/test/classes/plugin/transformations/Image_PNG_Inline_test.php index d72554e28b..01762e7783 100644 --- a/test/classes/plugin/transformations/Image_PNG_Inline_test.php +++ b/test/classes/plugin/transformations/Image_PNG_Inline_test.php @@ -124,7 +124,7 @@ class Image_PNG_Inline_Test extends PHPUnit_Framework_TestCase $buffer = "PMA_PNG_Inline"; $options = array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link"); $result = ''; diff --git a/test/classes/plugin/transformations/Text_Plain_Append_test.php b/test/classes/plugin/transformations/Text_Plain_Append_test.php index b5abf2a0c2..6a74066060 100644 --- a/test/classes/plugin/transformations/Text_Plain_Append_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Append_test.php @@ -34,7 +34,7 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Append(new PluginManager()); + $this->object = new Text_Plain_Append(new PluginManager()); } /** @@ -48,7 +48,7 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -58,14 +58,14 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase */ public function testGetInfo() { - $info = 'Appends text to a string. The only option is ' + $info = 'Appends text to a string. The only option is ' . 'the text to be appended' - . ' (enclosed in single quotes, default empty string).'; + . ' (enclosed in single quotes, default empty string).'; $this->assertEquals( $info, Text_Plain_Append::getInfo() - ); - + ); + } /** @@ -76,11 +76,11 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Append", Text_Plain_Append::getName() - ); + ); } /** @@ -91,11 +91,11 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Append::getMIMEType() - ); + ); } /** @@ -106,11 +106,11 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Append::getMIMESubtype() - ); + ); } /** @@ -127,19 +127,19 @@ class Text_Plain_Append_Test extends PHPUnit_Framework_TestCase $this->assertEquals( "PMA_BUFFERoption1", $this->object->applyTransformation($buffer, $options) - ); + ); //no options $result = "PMA_BUFFER"; $this->assertEquals( $result, $this->object->applyTransformation($buffer) ); - //html string + //html string $result = "PMA_BUFFER<a>abc</a>"; $options = array("abc"); $this->assertEquals( $result, $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php index d7b22fe0c3..6c689c4711 100644 --- a/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Dateformat_test.php @@ -165,7 +165,7 @@ class Text_Plain_Dateformat_Test extends PHPUnit_Framework_TestCase //string $timestamp = "20100201"; - $result = '' + $result = '' . 'Feb 01, 2010 at 12:00 AM'; $this->assertEquals( $result, diff --git a/test/classes/plugin/transformations/Text_Plain_External_test.php b/test/classes/plugin/transformations/Text_Plain_External_test.php index 8824ea1e42..c9a79accd4 100644 --- a/test/classes/plugin/transformations/Text_Plain_External_test.php +++ b/test/classes/plugin/transformations/Text_Plain_External_test.php @@ -156,8 +156,8 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase $this->object->applyTransformationNoWrap($options) ); $options = array( - "/dev/null -i -wrap -q", - "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", "/dev/null -i -wrap -q", 1 ); $this->assertEquals( @@ -165,8 +165,8 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase $this->object->applyTransformationNoWrap($options) ); $options = array( - "/dev/null -i -wrap -q", - "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", "/dev/null -i -wrap -q", "1" ); $this->assertEquals( @@ -174,9 +174,9 @@ class Text_Plain_External_Test extends PHPUnit_Framework_TestCase $this->object->applyTransformationNoWrap($options) ); $options = array( - "/dev/null -i -wrap -q", - "/dev/null -i -wrap -q", - "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", + "/dev/null -i -wrap -q", 2 ); $this->assertEquals( diff --git a/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php index 1fccd50990..19c48a6c37 100644 --- a/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Imagelink_test.php @@ -60,7 +60,7 @@ class Text_Plain_Imagelink_Test extends PHPUnit_Framework_TestCase { $info = 'Displays an image and a link; ' . 'the column contains the filename. The first option' - . ' is a URL prefix like "http://www.example.com/". ' + . ' is a URL prefix like "http://www.example.com/". ' . 'The second and third options' . ' are the width and the height in pixels.'; $this->assertEquals( diff --git a/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php b/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php index 7b8afeec57..60418cbf87 100644 --- a/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Longtoipv4_test.php @@ -35,7 +35,7 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Longtoipv4(new PluginManager()); + $this->object = new Text_Plain_Longtoipv4(new PluginManager()); } /** @@ -49,7 +49,7 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase { unset($this->object); } - + /** * Test for getInfo * @@ -60,12 +60,12 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase public function testGetInfo() { $info = 'Converts an (IPv4) Internet network address into a string in' - . ' Internet standard dotted format.'; + . ' Internet standard dotted format.'; $this->assertEquals( $info, Text_Plain_Longtoipv4::getInfo() - ); - + ); + } /** @@ -76,11 +76,11 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Long To IPv4", Text_Plain_Longtoipv4::getName() - ); + ); } /** @@ -91,11 +91,11 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Longtoipv4::getMIMEType() - ); + ); } /** @@ -106,11 +106,11 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Longtoipv4::getMIMESubtype() - ); + ); } /** @@ -127,14 +127,14 @@ class Text_Plain_Longtoipv4_Test extends PHPUnit_Framework_TestCase $this->assertEquals( "2.143.92.40", $this->object->applyTransformation($buffer, $options) - ); - - //too big + ); + + //too big $buffer = 4294967295; $options = array("option1", "option2"); $this->assertEquals( "255.255.255.255", $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/plugin/transformations/Text_Plain_Substring_test.php b/test/classes/plugin/transformations/Text_Plain_Substring_test.php index 05daea86b9..51be484ba2 100644 --- a/test/classes/plugin/transformations/Text_Plain_Substring_test.php +++ b/test/classes/plugin/transformations/Text_Plain_Substring_test.php @@ -35,7 +35,7 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new Text_Plain_Substring(new PluginManager()); + $this->object = new Text_Plain_Substring(new PluginManager()); } /** @@ -63,11 +63,11 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase . ' characters to skip from the beginning of the string (Default 0).' . ' The second option is the number of characters to return (Default:' . ' until end of string). The third option is the string to append'; - + $this->assertContains( $info, Text_Plain_Substring::getInfo() - ); + ); } /** @@ -78,11 +78,11 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetName() - { + { $this->assertEquals( "Substring", Text_Plain_Substring::getName() - ); + ); } /** @@ -93,11 +93,11 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMEType() - { + { $this->assertEquals( "Text", Text_Plain_Substring::getMIMEType() - ); + ); } /** @@ -108,11 +108,11 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testGetMIMESubtype() - { + { $this->assertEquals( "Plain", Text_Plain_Substring::getMIMESubtype() - ); + ); } /** @@ -129,6 +129,6 @@ class Text_Plain_Substring_Test extends PHPUnit_Framework_TestCase $this->assertEquals( "suffixMA_suffix", $this->object->applyTransformation($buffer, $options) - ); + ); } } diff --git a/test/classes/properties/PMA_PorpertyItem_test.php b/test/classes/properties/PMA_PorpertyItem_test.php index 13ae842d9b..90c8118856 100644 --- a/test/classes/properties/PMA_PorpertyItem_test.php +++ b/test/classes/properties/PMA_PorpertyItem_test.php @@ -10,7 +10,7 @@ require_once 'libraries/properties/PropertyItem.class.php'; /** * Tests for PropertyItem class - * + * * @package PhpMyAdmin-test */ class PMA_PropertyItem_Test extends PHPUnit_Framework_TestCase @@ -29,7 +29,7 @@ class PMA_PropertyItem_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -39,7 +39,7 @@ class PMA_PropertyItem_Test extends PHPUnit_Framework_TestCase /** * Test for PropertyItem::getGroup - * + * * @return void */ public function testGetGroup() diff --git a/test/classes/properties/options/PMA_OptionsPropertyGroup_test.php b/test/classes/properties/options/PMA_OptionsPropertyGroup_test.php index 134a0f9c0b..7e4ebcb702 100644 --- a/test/classes/properties/options/PMA_OptionsPropertyGroup_test.php +++ b/test/classes/properties/options/PMA_OptionsPropertyGroup_test.php @@ -10,7 +10,7 @@ require_once 'libraries/properties/options/OptionsPropertyGroup.class.php'; /** * Tests for OptionsPropertyGroup class - * + * * @package PhpMyAdmin-test */ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase @@ -29,7 +29,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -39,7 +39,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyGroup::addProperty - * + * * @return void */ public function testAddProperty() @@ -63,7 +63,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyGroup::removeProperty - * + * * @return void */ public function testRemoveProperty() @@ -95,7 +95,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyGroup::getGroup - * + * * @return void */ public function testGetGroup() @@ -108,7 +108,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyGroup::getProperties - * + * * @return void */ public function testGetProperties() @@ -125,7 +125,7 @@ class PMA_OptionsPropertyGroup_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyGroup::getProperties - * + * * @return void */ public function testGetNrOfProperties() diff --git a/test/classes/properties/options/PMA_OptionsPropertyItem_test.php b/test/classes/properties/options/PMA_OptionsPropertyItem_test.php index 52a2b19833..fd77bb185e 100644 --- a/test/classes/properties/options/PMA_OptionsPropertyItem_test.php +++ b/test/classes/properties/options/PMA_OptionsPropertyItem_test.php @@ -10,7 +10,7 @@ require_once 'libraries/properties/options/OptionsPropertyItem.class.php'; /** * Tests for OptionsPropertyItem class - * + * * @package PhpMyAdmin-test */ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase @@ -29,7 +29,7 @@ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -41,7 +41,7 @@ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyItem::getName * - OptionsPropertyItem::setName - * + * * @return void */ public function testGetSetName() @@ -58,7 +58,7 @@ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyItem::getText * - OptionsPropertyItem::setText - * + * * @return void */ public function testGetSetText() @@ -75,7 +75,7 @@ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyItem::getForce * - OptionsPropertyItem::setForce - * + * * @return void */ public function testGetSetForce() @@ -90,7 +90,7 @@ class PMA_OptionsPropertyItem_Test extends PHPUnit_Framework_TestCase /** * Test for OptionsPropertyItem::getPropertyType - * + * * @return void */ public function testGetPropertyType() diff --git a/test/classes/properties/options/PMA_OptionsPropertyOneItem_test.php b/test/classes/properties/options/PMA_OptionsPropertyOneItem_test.php index 63d7f07112..142c201197 100644 --- a/test/classes/properties/options/PMA_OptionsPropertyOneItem_test.php +++ b/test/classes/properties/options/PMA_OptionsPropertyOneItem_test.php @@ -10,7 +10,7 @@ require_once 'libraries/properties/options/OptionsPropertyOneItem.class.php'; /** * Tests for OptionsPropertyOneItem class - * + * * @package PhpMyAdmin-test */ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase @@ -29,7 +29,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -41,7 +41,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyOneItem::getValues * - OptionsPropertyOneItem::setValues - * + * * @return void */ public function testGetSetValues() @@ -58,7 +58,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyOneItem::getLen * - OptionsPropertyOneItem::setLen - * + * * @return void */ public function testGetSetLen() @@ -75,7 +75,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyOneItem::getForce * - OptionsPropertyOneItem::setForce - * + * * @return void */ public function testGetSetForce() @@ -92,7 +92,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyOneItem::getDoc * - OptionsPropertyOneItem::setDoc - * + * * @return void */ public function testGetSetDoc() @@ -109,7 +109,7 @@ class PMA_OptionsPropertyOneItem_Test extends PHPUnit_Framework_TestCase * Test for * - OptionsPropertyOneItem::getSize * - OptionsPropertyOneItem::setSize - * + * * @return void */ public function testGetSetSize() diff --git a/test/classes/properties/options/groups/PMA_OptionsPropertyMainGroup_test.php b/test/classes/properties/options/groups/PMA_OptionsPropertyMainGroup_test.php index 66569114fc..2d12f8e716 100644 --- a/test/classes/properties/options/groups/PMA_OptionsPropertyMainGroup_test.php +++ b/test/classes/properties/options/groups/PMA_OptionsPropertyMainGroup_test.php @@ -28,17 +28,17 @@ class PMA_OptionsPropertyMainGroup_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ protected function tearDown() { unset($this->object); } - + /** * Test for OptionsPropertyMainGroup::getItemType - * + * * @return void */ public function testGetItemType() diff --git a/test/classes/properties/options/groups/PMA_OptionsPropertyRootGroup_test.php b/test/classes/properties/options/groups/PMA_OptionsPropertyRootGroup_test.php index fa76c6f3d5..e688ff4df8 100644 --- a/test/classes/properties/options/groups/PMA_OptionsPropertyRootGroup_test.php +++ b/test/classes/properties/options/groups/PMA_OptionsPropertyRootGroup_test.php @@ -28,17 +28,17 @@ class PMA_OptionsPropertyRootGroup_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ protected function tearDown() { unset($this->object); } - + /** * Test for OptionsPropertyRootGroup::getItemType - * + * * @return void */ public function testGetItemType() diff --git a/test/classes/properties/options/groups/PMA_OptionsPropertySubgroup_test.php b/test/classes/properties/options/groups/PMA_OptionsPropertySubgroup_test.php index 7c0b74677b..286671ced5 100644 --- a/test/classes/properties/options/groups/PMA_OptionsPropertySubgroup_test.php +++ b/test/classes/properties/options/groups/PMA_OptionsPropertySubgroup_test.php @@ -28,17 +28,17 @@ class PMA_OptionsPropertySubgroup_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ protected function tearDown() { unset($this->object); } - + /** * Test for OptionsPropertySubgroup::getItemType - * + * * @return void */ public function testGetItemType() @@ -52,8 +52,8 @@ class PMA_OptionsPropertySubgroup_Test extends PHPUnit_Framework_TestCase /** * Test for * - OptionsPropertySubgroup::getSubgroupHeader - * - OptionsPropertySubgroup::setSubgroupHeader - * + * - OptionsPropertySubgroup::setSubgroupHeader + * * @return void */ public function testGetSetSubgroupHeader() diff --git a/test/classes/properties/options/items/PMA_PropertyItems_test.php b/test/classes/properties/options/items/PMA_PropertyItems_test.php index 9ecde7c3ce..04b71e806c 100644 --- a/test/classes/properties/options/items/PMA_PropertyItems_test.php +++ b/test/classes/properties/options/items/PMA_PropertyItems_test.php @@ -22,7 +22,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase { /** * Test for BoolPropertyItem::getItemType - * + * * @return void */ public function testBoolGetItemType() @@ -37,7 +37,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for DocPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeDoc() @@ -52,7 +52,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for HiddenPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeHidden() @@ -67,7 +67,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for MessageOnlyPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeMessageOnly() @@ -82,7 +82,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for RadioPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeRadio() @@ -97,7 +97,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for SelectPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeSelect() @@ -112,7 +112,7 @@ class PMA_PropertyItems_Test extends PHPUnit_Framework_TestCase /** * Test for TextPropertyItem::getItemType - * + * * @return void */ public function testGetItemTypeText() diff --git a/test/classes/properties/plugins/PMA_ExportPluginProperties_test.php b/test/classes/properties/plugins/PMA_ExportPluginProperties_test.php index 892f9ccd31..92ba0a2cd6 100644 --- a/test/classes/properties/plugins/PMA_ExportPluginProperties_test.php +++ b/test/classes/properties/plugins/PMA_ExportPluginProperties_test.php @@ -11,9 +11,9 @@ require_once 'libraries/properties/options/groups/OptionsPropertyRootGroup.class require_once 'test/classes/properties/plugins/PMA_ImportPluginProperties_test.php'; /** - * Tests for ExportPluginProperties class. Extends PMA_ImportPluginProperties_Tests + * Tests for ExportPluginProperties class. Extends PMA_ImportPluginProperties_Tests * and adds tests for methods that are not common to both - * + * * @package PhpMyAdmin-test */ class PMA_ExportPluginProperties_Test extends PMA_ImportPluginProperties_Test @@ -32,7 +32,7 @@ class PMA_ExportPluginProperties_Test extends PMA_ImportPluginProperties_Test /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -42,7 +42,7 @@ class PMA_ExportPluginProperties_Test extends PMA_ImportPluginProperties_Test /** * Test for ExportPluginProperties::getItemType - * + * * @return void */ public function testGetItemType() @@ -57,7 +57,7 @@ class PMA_ExportPluginProperties_Test extends PMA_ImportPluginProperties_Test * Test for * - ExportPluginProperties::getForceFile * - ExportPluginProperties::setForceFile - * + * * @return void */ public function testSetGetForceFile() diff --git a/test/classes/properties/plugins/PMA_ImportPluginProperties_test.php b/test/classes/properties/plugins/PMA_ImportPluginProperties_test.php index 2f957c85aa..602f6b0599 100644 --- a/test/classes/properties/plugins/PMA_ImportPluginProperties_test.php +++ b/test/classes/properties/plugins/PMA_ImportPluginProperties_test.php @@ -29,17 +29,17 @@ class PMA_ImportPluginProperties_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ protected function tearDown() { unset($this->object); } - + /** * Test for ImportPluginProperties::getItemType - * + * * @return void */ public function testGetItemType() @@ -51,10 +51,10 @@ class PMA_ImportPluginProperties_Test extends PHPUnit_Framework_TestCase } /** - * Test for + * Test for * - ImportPluginProperties::getOptionsText * - ImportPluginProperties::setOptionsText - * + * * @return void */ public function testSetGetOptionsText() @@ -68,10 +68,10 @@ class PMA_ImportPluginProperties_Test extends PHPUnit_Framework_TestCase } /** - * Test for + * Test for * - ImportPluginProperties::setMimeType * - ImportPluginProperties::getMimeType - * + * * @return void */ public function testSetGetMimeType() diff --git a/test/classes/properties/plugins/PMA_PluginPorpertyItem_test.php b/test/classes/properties/plugins/PMA_PluginPorpertyItem_test.php index 7b5f209f39..13195f2866 100644 --- a/test/classes/properties/plugins/PMA_PluginPorpertyItem_test.php +++ b/test/classes/properties/plugins/PMA_PluginPorpertyItem_test.php @@ -10,7 +10,7 @@ require_once 'libraries/properties/plugins/PluginPropertyItem.class.php'; /** * Tests for PluginPropertyItem class - * + * * @package PhpMyAdmin-test */ class PMA_PluginPropertyItem_Test extends PHPUnit_Framework_TestCase @@ -29,7 +29,7 @@ class PMA_PluginPropertyItem_Test extends PHPUnit_Framework_TestCase /** * tearDown for test cases - * + * * @return void */ public function tearDown() @@ -39,7 +39,7 @@ class PMA_PluginPropertyItem_Test extends PHPUnit_Framework_TestCase /** * Test for PluginPropertyItem::getPropertyType - * + * * @return void */ public function testGetPropertyType() diff --git a/test/classes/schema/Dia_Relation_Schema_test.php b/test/classes/schema/Dia_Relation_Schema_test.php index 43ad2fa37c..6cb086d605 100644 --- a/test/classes/schema/Dia_Relation_Schema_test.php +++ b/test/classes/schema/Dia_Relation_Schema_test.php @@ -46,13 +46,13 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase $_POST['orientation'] = 'orientation'; $_POST['paper'] = 'paper'; $_POST['export_type'] = 'PMA_ExportType'; - + $GLOBALS['server'] = 1; $GLOBALS['controllink'] = null; $GLOBALS['db'] = 'information_schema'; $GLOBALS['cfg']['ServerDefault'] = 1; $GLOBALS['cfg']['Server']['table_coords'] = "table_name"; - + //_SESSION $_SESSION['relation'][$GLOBALS['server']] = array( 'table_coords' => "table_name", @@ -62,28 +62,28 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase 'relwork' => 'relwork', 'relation' => 'relation' ); - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); - + $dbi->expects($this->any()) ->method('numRows') ->will($this->returnValue(1)); - + $dbi->expects($this->any()) ->method('query') ->will($this->returnValue("executed_1")); - + $dbi->expects($this->any()) ->method('tryQuery') ->will($this->returnValue("executed_1")); - + $fetchArrayReturn = array( //table name in information_schema_relations 'table_name' => 'CHARACTER_SETS' ); - + $fetchArrayReturn2 = array( //table name in information_schema_relations 'table_name' => 'COLLATIONS' @@ -98,7 +98,7 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->at(4)) ->method('fetchAssoc') ->will($this->returnValue(false)); - + $getIndexesResult = array( array( 'Table' => 'pma_tbl', @@ -110,7 +110,7 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase ); $dbi->expects($this->any())->method('getTableIndexes') ->will($this->returnValue($getIndexesResult)); - + $fetchValue = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dbase` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', @@ -118,15 +118,15 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase `label` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `query` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) - ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " + ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " . "COLLATE=utf8_bin COMMENT='Bookmarks'"; - + $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue($fetchValue)); + ->will($this->returnValue($fetchValue)); $GLOBALS['dbi'] = $dbi; - + $this->object = new PMA_Dia_Relation_Schema(); } @@ -154,27 +154,27 @@ class PMA_Dia_Relation_Schema_Test extends PHPUnit_Framework_TestCase $this->assertEquals( 33, $this->object->pageNumber - ); + ); $this->assertEquals( 1, $this->object->showGrid - ); + ); $this->assertEquals( 1, $this->object->showColor - ); + ); $this->assertEquals( 1, $this->object->showKeys - ); + ); $this->assertEquals( 'P', $this->object->orientation - ); + ); $this->assertEquals( 'paper', $this->object->paper - ); + ); $this->assertEquals( 'PMA_ExportType', $this->object->exportType diff --git a/test/classes/schema/Eps_Relation_Schema_test.php b/test/classes/schema/Eps_Relation_Schema_test.php index ea78627987..1fb2c21220 100644 --- a/test/classes/schema/Eps_Relation_Schema_test.php +++ b/test/classes/schema/Eps_Relation_Schema_test.php @@ -52,7 +52,7 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase $GLOBALS['db'] = 'information_schema'; $GLOBALS['cfg']['ServerDefault'] = 1; $GLOBALS['cfg']['Server']['table_coords'] = "table_name"; - + //_SESSION $_SESSION['relation'][$GLOBALS['server']] = array( 'table_coords' => "table_name", @@ -62,28 +62,28 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase 'relwork' => 'relwork', 'relation' => 'relation' ); - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); - + $dbi->expects($this->any()) ->method('numRows') ->will($this->returnValue(1)); - + $dbi->expects($this->any()) ->method('query') ->will($this->returnValue("executed_1")); - + $dbi->expects($this->any()) ->method('tryQuery') ->will($this->returnValue("executed_1")); - + $fetchArrayReturn = array( //table name in information_schema_relations 'table_name' => 'CHARACTER_SETS' ); - + $fetchArrayReturn2 = array( //table name in information_schema_relations 'table_name' => 'COLLATIONS' @@ -98,7 +98,7 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->at(4)) ->method('fetchAssoc') ->will($this->returnValue(false)); - + $getIndexesResult = array( array( 'Table' => 'pma_tbl', @@ -110,7 +110,7 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase ); $dbi->expects($this->any())->method('getTableIndexes') ->will($this->returnValue($getIndexesResult)); - + $fetchValue = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dbase` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', @@ -118,16 +118,16 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase `label` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `query` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) - ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " + ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " . "COLLATE=utf8_bin COMMENT='Bookmarks'"; - + $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue($fetchValue)); + ->will($this->returnValue($fetchValue)); $GLOBALS['dbi'] = $dbi; - - $this->object = new PMA_Eps_Relation_Schema(); + + $this->object = new PMA_Eps_Relation_Schema(); } /** @@ -150,23 +150,23 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testConstructor() - { + { $this->assertEquals( 33, $this->object->pageNumber - ); + ); $this->assertEquals( 1, $this->object->showColor - ); + ); $this->assertEquals( 1, $this->object->showKeys - ); + ); $this->assertEquals( 1, $this->object->tableDimension - ); + ); $this->assertEquals( 1, $this->object->sameWide @@ -174,7 +174,7 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase $this->assertEquals( 'L', $this->object->orientation - ); + ); $this->assertEquals( 'PMA_ExportType', $this->object->exportType @@ -190,7 +190,7 @@ class PMA_Eps_Relation_Schema_Test extends PHPUnit_Framework_TestCase */ public function testSetPageNumbere() { - $this->object->setPageNumber(33); + $this->object->setPageNumber(33); $this->assertEquals( 33, $this->object->pageNumber diff --git a/test/classes/schema/Pdf_Relation_Schema_test.php b/test/classes/schema/Pdf_Relation_Schema_test.php index 46499c2bcb..3267587cfe 100644 --- a/test/classes/schema/Pdf_Relation_Schema_test.php +++ b/test/classes/schema/Pdf_Relation_Schema_test.php @@ -50,7 +50,7 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase $_POST['paper'] = 'paper'; $_POST['export_type'] = 'PMA_ExportType'; $_POST['with_doc'] = 'on'; - + $GLOBALS['server'] = 1; $GLOBALS['controllink'] = null; $GLOBALS['db'] = 'information_schema'; @@ -62,7 +62,7 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['Server']['bookmarktable'] = "bookmarktable"; $GLOBALS['cfg']['Server']['relation'] = "relation"; $GLOBALS['cfg']['Server']['table_info'] = "table_info"; - + //_SESSION $_SESSION['relation'][$GLOBALS['server']] = array( 'table_coords' => "table_name", @@ -75,28 +75,28 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase 'commwork' => 'commwork', 'column_info' => 'column_info' ); - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); - + $dbi->expects($this->any()) ->method('numRows') ->will($this->returnValue(1)); - + $dbi->expects($this->any()) ->method('query') ->will($this->returnValue("executed_1")); - + $dbi->expects($this->any()) ->method('tryQuery') ->will($this->returnValue("executed_1")); - + $fetchArrayReturn = array( //table name in information_schema_relations 'table_name' => 'CHARACTER_SETS' ); - + $fetchArrayReturn2 = array( //table name in information_schema_relations 'table_name' => 'COLLATIONS' @@ -111,7 +111,7 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->at(4)) ->method('fetchAssoc') ->will($this->returnValue(false)); - + $fetchRowReturn = array( 'table_name' ); @@ -122,7 +122,7 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase ->method('fetchRow') ->will($this->returnValue($fetchRowReturn)); } - + $dbi->expects($this->at(10)) ->method('fetchRow') ->will($this->returnValue($fetchRowReturn)); @@ -137,10 +137,10 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase ); $dbi->expects($this->any())->method('getColumns') ->will($this->returnValue($fields_info)); - + $dbi->expects($this->any())->method('selectDb') ->will($this->returnValue(true)); - + $getIndexesResult = array( array( 'Table' => 'pma_tbl', @@ -152,7 +152,7 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase ); $dbi->expects($this->any())->method('getTableIndexes') ->will($this->returnValue($getIndexesResult)); - + $fetchValue = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dbase` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', @@ -160,25 +160,25 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase `label` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `query` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) - ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " + ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " . "COLLATE=utf8_bin COMMENT='Bookmarks'"; - + $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue($fetchValue)); + ->will($this->returnValue($fetchValue)); $fetchResult = array( 'column1' => array('mimetype' => 'value1', 'transformation'=> 'pdf'), 'column2' => array('mimetype' => 'value2', 'transformation'=> 'xml'), ); - + $dbi->expects($this->any())->method('fetchResult') ->will($this->returnValue($fetchResult)); - + $GLOBALS['dbi'] = $dbi; - - $this->object = new PMA_Pdf_Relation_Schema(); + + $this->object = new PMA_Pdf_Relation_Schema(); } /** @@ -201,31 +201,31 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testConstructor() - { + { $this->assertEquals( 33, $this->object->pageNumber - ); + ); $this->assertEquals( 1, $this->object->showGrid - ); + ); $this->assertEquals( 1, $this->object->showColor - ); + ); $this->assertEquals( 1, $this->object->showKeys - ); + ); $this->assertEquals( 1, $this->object->tableDimension - ); + ); $this->assertEquals( 1, $this->object->sameWide - ); + ); $this->assertEquals( 1, $this->object->withDoc @@ -233,14 +233,14 @@ class PMA_Pdf_Relation_Schema_Test extends PHPUnit_Framework_TestCase $this->assertEquals( 'L', $this->object->orientation - ); + ); $this->assertEquals( 'PMA_ExportType', $this->object->exportType - ); + ); $this->assertEquals( 'paper', $this->object->paper - ); + ); } } diff --git a/test/classes/schema/Svg_Relation_Schema_test.php b/test/classes/schema/Svg_Relation_Schema_test.php index 2640bafa88..fe916c8ad0 100644 --- a/test/classes/schema/Svg_Relation_Schema_test.php +++ b/test/classes/schema/Svg_Relation_Schema_test.php @@ -53,7 +53,7 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase $GLOBALS['db'] = 'information_schema'; $GLOBALS['cfg']['ServerDefault'] = 1; $GLOBALS['cfg']['Server']['table_coords'] = "table_name"; - + //_SESSION $_SESSION['relation'][$GLOBALS['server']] = array( 'table_coords' => "table_name", @@ -63,28 +63,28 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase 'relwork' => 'relwork', 'relation' => 'relation' ); - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); - + $dbi->expects($this->any()) ->method('numRows') ->will($this->returnValue(1)); - + $dbi->expects($this->any()) ->method('query') ->will($this->returnValue("executed_1")); - + $dbi->expects($this->any()) ->method('tryQuery') ->will($this->returnValue("executed_1")); - + $fetchArrayReturn = array( //table name in information_schema_relations 'table_name' => 'CHARACTER_SETS' ); - + $fetchArrayReturn2 = array( //table name in information_schema_relations 'table_name' => 'COLLATIONS' @@ -99,7 +99,7 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase $dbi->expects($this->at(4)) ->method('fetchAssoc') ->will($this->returnValue(false)); - + $getIndexesResult = array( array( 'Table' => 'pma_tbl', @@ -111,7 +111,7 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase ); $dbi->expects($this->any())->method('getTableIndexes') ->will($this->returnValue($getIndexesResult)); - + $fetchValue = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dbase` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', @@ -119,16 +119,16 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase `label` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `query` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) - ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " + ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 " . "COLLATE=utf8_bin COMMENT='Bookmarks'"; - + $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue($fetchValue)); + ->will($this->returnValue($fetchValue)); $GLOBALS['dbi'] = $dbi; - - $this->object = new PMA_Svg_Relation_Schema(); + + $this->object = new PMA_Svg_Relation_Schema(); } /** @@ -151,23 +151,23 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase * @group medium */ public function testConstructor() - { + { $this->assertEquals( 33, $this->object->pageNumber - ); + ); $this->assertEquals( 1, $this->object->showColor - ); + ); $this->assertEquals( 1, $this->object->showKeys - ); + ); $this->assertEquals( 1, $this->object->tableDimension - ); + ); $this->assertEquals( 1, $this->object->sameWide @@ -175,6 +175,6 @@ class PMA_Svg_Relation_Schema_Test extends PHPUnit_Framework_TestCase $this->assertEquals( 'PMA_ExportType', $this->object->exportType - ); + ); } } diff --git a/test/classes/schema/Svg_test.php b/test/classes/schema/Svg_test.php index c752a4a99e..5f4014130e 100644 --- a/test/classes/schema/Svg_test.php +++ b/test/classes/schema/Svg_test.php @@ -31,7 +31,7 @@ class PMA_Svg_Test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new PMA_SVG(); + $this->object = new PMA_SVG(); } /** @@ -76,7 +76,7 @@ class PMA_Svg_Test extends PHPUnit_Framework_TestCase 12, $this->object->getStringWidth("aa", "arial", "10") ); - + // string "i" $this->assertEquals( 3, diff --git a/test/classes/schema/User_Schema_test.php b/test/classes/schema/User_Schema_test.php index 2c23bbb3db..df13967293 100644 --- a/test/classes/schema/User_Schema_test.php +++ b/test/classes/schema/User_Schema_test.php @@ -55,14 +55,14 @@ class PMA_User_Schema_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfgRelation']['table_coords'] = "table_name"; $GLOBALS['cfgRelation']['pdf_pages'] = "pdf_pages"; $GLOBALS['cfgRelation']['relation'] = "relation"; - + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') ->disableOriginalConstructor() ->getMock(); - + $dbi->expects($this->any()) ->method('insertId') - ->will($this->returnValue(10)); + ->will($this->returnValue(10)); $databases = array(); $database_name = 'PMA'; @@ -73,13 +73,13 @@ class PMA_User_Schema_Test extends PHPUnit_Framework_TestCase $databases[$database_name]['SCHEMA_INDEX_LENGTH'] = 10; $databases[$database_name]['SCHEMA_LENGTH'] = 10; $databases[$database_name]['ENGINE'] = "InnerDB"; - + $dbi->expects($this->any())->method('getTablesFull') - ->will($this->returnValue($databases)); + ->will($this->returnValue($databases)); $GLOBALS['dbi'] = $dbi; - - $this->object = new PMA_User_Schema(); + + $this->object = new PMA_User_Schema(); } /** @@ -106,48 +106,48 @@ class PMA_User_Schema_Test extends PHPUnit_Framework_TestCase //action: selectpage $_REQUEST['chpage'] = 10; $_REQUEST['action_choose'] = '2'; - $this->object->setAction("selectpage"); - $this->object->processUserChoice(); + $this->object->setAction("selectpage"); + $this->object->processUserChoice(); $this->assertEquals( "selectpage", $this->object->action - ); + ); $this->assertEquals( 10, $this->object->chosenPage ); - + $_REQUEST['action_choose'] = '1'; - $this->object->processUserChoice(); + $this->object->processUserChoice(); //deleteCoordinates successfully $this->assertEquals( 0, $this->object->chosenPage ); - + //action: createpage $_POST['newpage'] = "3"; $_POST['auto_layout_foreign'] = true; $_POST['auto_layout_internal'] = true; $_POST['delrow'] = array("row1", "row2"); $_POST['chpage'] = "chpage"; - $this->object->setAction("delete_old_references"); - $this->object->processUserChoice(); - $this->object->setAction("createpage"); - $this->object->processUserChoice(); + $this->object->setAction("delete_old_references"); + $this->object->processUserChoice(); + $this->object->setAction("createpage"); + $this->object->processUserChoice(); $this->assertEquals( 10, $this->object->pageNumber - ); + ); $this->assertEquals( "1", $this->object->autoLayoutForeign - ); + ); $this->assertEquals( "1", $this->object->autoLayoutInternal ); - + //action: edcoord $_POST['chpage'] = "3"; $_POST['c_table_rows'] = 1; @@ -158,15 +158,15 @@ class PMA_User_Schema_Test extends PHPUnit_Framework_TestCase 'delete' => 'delete0', 'x' => 'x0', ); - $this->object->setAction("edcoord"); - $this->object->processUserChoice(); + $this->object->setAction("edcoord"); + $this->object->processUserChoice(); $this->assertEquals( '3', $this->object->chosenPage - ); + ); $this->assertEquals( 1, $this->object->c_table_rows - ); + ); } } From 0c887a5a55f0fb117ff676064fc6aaf07f01b028 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sun, 3 Nov 2013 19:16:50 +0530 Subject: [PATCH 3/5] Trailing white spaces --- test/engines/PMA_StorageEngine_pbxt_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/engines/PMA_StorageEngine_pbxt_test.php b/test/engines/PMA_StorageEngine_pbxt_test.php index a14914d59b..1be7198792 100644 --- a/test/engines/PMA_StorageEngine_pbxt_test.php +++ b/test/engines/PMA_StorageEngine_pbxt_test.php @@ -201,9 +201,9 @@ class PMA_StorageEngine_pbxt_Test extends PHPUnit_Framework_TestCase . '

' . "\n" . '

' . __('Related Links') . '

' . "\n" . '' . "\n" ); From 3b70bbc44e0eff81df0a047a2800e0de200f250f Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sun, 3 Nov 2013 19:20:24 +0530 Subject: [PATCH 4/5] Remove more trailing white spaces --- test/AllSeleniumTests.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/AllSeleniumTests.php b/test/AllSeleniumTests.php index f4a88e09f8..84de14d455 100644 --- a/test/AllSeleniumTests.php +++ b/test/AllSeleniumTests.php @@ -17,9 +17,9 @@ require_once __DIR__.'/selenium/PmaSeleniumCreateRemoveUserTest.php'; /** * AllSeleniumTests class - * + * * Runs all the selenium test cases - * + * * @package PhpMyAdmin-test * @subpackage Selenium */ @@ -38,8 +38,8 @@ class AllSeleniumTests /** * Creates a SeleniumTestSuite and add all the selenium test cases to it - * - * @return PHPUnit_Extensions_SeleniumTestSuite + * + * @return PHPUnit_Extensions_SeleniumTestSuite */ public static function suite() { From 8fd0d79405c0efb0d2dbe6fce45c1340fb92a4da Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 3 Nov 2013 09:55:39 -0500 Subject: [PATCH 5/5] The DisableIS directive is being deprecated --- libraries/navigation/Nodes/Node.class.php | 20 ++------- test/classes/navigation/PMA_Node_test.php | 49 ++--------------------- 2 files changed, 7 insertions(+), 62 deletions(-) diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index 9ae86fe290..5a85572400 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -379,22 +379,10 @@ class Node */ public function getPresence($type = '', $searchClause = '') { - if (! $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['DisableIS']) { - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; - $query .= $this->_getWhereClause($searchClause); - $retval = (int)$GLOBALS['dbi']->fetchValue($query); - } else { - $query = "SHOW DATABASES "; - if (! empty($searchClause)) { - $query .= "LIKE '%"; - $query .= PMA_Util::sqlAddSlashes( - $searchClause, true - ); - $query .= "%' "; - } - $retval = $GLOBALS['dbi']->numRows($GLOBALS['dbi']->tryQuery($query)); - } + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; + $query .= $this->_getWhereClause($searchClause); + $retval = (int)$GLOBALS['dbi']->fetchValue($query); return $retval; } diff --git a/test/classes/navigation/PMA_Node_test.php b/test/classes/navigation/PMA_Node_test.php index d75866e59d..9dd221fffa 100644 --- a/test/classes/navigation/PMA_Node_test.php +++ b/test/classes/navigation/PMA_Node_test.php @@ -365,12 +365,12 @@ class Node_Test extends PHPUnit_Framework_TestCase } /** - * Tests the getPresence method when DisableIS is false + * Tests the getPresence method * * @return void * @test */ - public function testGetPresenceWithEnabledIS() + public function testGetPresence() { if (! isset($GLOBALS['cfg'])) { $GLOBALS['cfg'] = array(); @@ -381,14 +381,13 @@ class Node_Test extends PHPUnit_Framework_TestCase if (! isset($GLOBALS['cfg']['Servers'][0])) { $GLOBALS['cfg']['Servers'][0] = array(); } - $GLOBALS['cfg']['Servers'][0]['DisableIS'] = false; $query = "SELECT COUNT(*) "; $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; $query .= "WHERE TRUE "; // It would have been better to mock _getWhereClause method - // but stangely, mocking private methods is not supported in PHPUnit + // but strangely, mocking private methods is not supported in PHPUnit $node = PMA_NodeFactory::getInstance(); $dbi = $this->getMockBuilder('PMA_DatabaseInterface') @@ -400,47 +399,5 @@ class Node_Test extends PHPUnit_Framework_TestCase $GLOBALS['dbi'] = $dbi; $node->getPresence(); } - - /** - * Tests the getPresence method when DisableIS is true - * - * @return void - * @test - */ - public function testGetPresenceWithDisabledIS() - { - if (! isset($GLOBALS['cfg'])) { - $GLOBALS['cfg'] = array(); - } - if (! isset($GLOBALS['cfg']['Servers'])) { - $GLOBALS['cfg']['Servers'] = array(); - } - if (! isset($GLOBALS['cfg']['Servers'][0])) { - $GLOBALS['cfg']['Servers'][0] = array(); - } - $GLOBALS['cfg']['Servers'][0]['DisableIS'] = true; - - $node = PMA_NodeFactory::getInstance(); - - // test with no search clause - $dbi = $this->getMockBuilder('PMA_DatabaseInterface') - ->disableOriginalConstructor() - ->getMock(); - $dbi->expects($this->once()) - ->method('tryQuery') - ->with("SHOW DATABASES "); - $GLOBALS['dbi'] = $dbi; - $node->getPresence(); - - // test with a search clause - $dbi = $this->getMockBuilder('PMA_DatabaseInterface') - ->disableOriginalConstructor() - ->getMock(); - $dbi->expects($this->once()) - ->method('tryQuery') - ->with("SHOW DATABASES LIKE '%dbname%' "); - $GLOBALS['dbi'] = $dbi; - $node->getPresence('', 'dbname'); - } } ?>