diff options
author | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2018-05-30 10:33:50 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2018-05-30 15:07:56 +0300 |
commit | 285e38e931635a5d72bc75d38c891ee27a491d1a (patch) | |
tree | 69d809e2551f80c7831a51da6d3e54b37d9ddbdc /test | |
parent | d248fd419d5ed78c42ff2b7ce590239932479b0c (diff) |
Fix some PSR-2 coding standard errors
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'test')
100 files changed, 1803 insertions, 547 deletions
diff --git a/test/classes/CentralColumnsTest.php b/test/classes/CentralColumnsTest.php index 16816e76ea..4be7ab940e 100644 --- a/test/classes/CentralColumnsTest.php +++ b/test/classes/CentralColumnsTest.php @@ -210,7 +210,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT count(db_name) FROM `pma_central_columns` " . "WHERE db_name = 'phpmyadmin';", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue([3]) @@ -255,7 +257,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT col_name FROM `pma_central_columns` " . "WHERE db_name = 'PMA_db' AND col_name IN ('col1');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue(['col1']) @@ -281,14 +285,16 @@ class CentralColumnsTest extends TestCase // when column does not exist in the central column list $this->assertInstanceOf( - 'PhpMyAdmin\Message', $this->centralColumns->deleteColumnsFromList( + 'PhpMyAdmin\Message', + $this->centralColumns->deleteColumnsFromList( ['column1'], false ) ); $this->assertInstanceOf( - 'PhpMyAdmin\Message', $this->centralColumns->deleteColumnsFromList( + 'PhpMyAdmin\Message', + $this->centralColumns->deleteColumnsFromList( ['PMA_table'] ) ); @@ -334,7 +340,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT col_name FROM `pma_central_columns` " . "WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue(['id','col1']) @@ -363,7 +371,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT * FROM `pma_central_columns` " . "WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue(array_slice($this->columnData, 0, 2)) @@ -387,12 +397,30 @@ class CentralColumnsTest extends TestCase { $this->assertTrue( $this->centralColumns->updateOneColumn( - "phpmyadmin", "", "", "", "", "", 0, "", "", "" + "phpmyadmin", + "", + "", + "", + "", + "", + 0, + "", + "", + "" ) ); $this->assertTrue( $this->centralColumns->updateOneColumn( - "phpmyadmin", "col1", "", "", "", "", 0, "", "", "" + "phpmyadmin", + "col1", + "", + "", + "", + "", + 0, + "", + "", + "" ) ); } @@ -416,7 +444,6 @@ class CentralColumnsTest extends TestCase $this->assertTrue( $this->centralColumns->updateMultipleColumn() ); - } /** @@ -431,7 +458,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT * FROM `pma_central_columns` " . "WHERE db_name = 'phpmyadmin' AND col_name IN ('col1','col2');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue($this->columnData) @@ -477,7 +506,6 @@ class CentralColumnsTest extends TestCase $this->callProtectedMethod('getEditTableFooter'), $result ); - } /** @@ -523,7 +551,10 @@ class CentralColumnsTest extends TestCase ); $this->assertContains( Util::pageselector( - 'pos', 10, 2, 3 + 'pos', + 10, + 2, + 3 ), $result_1 ); @@ -545,7 +576,9 @@ class CentralColumnsTest extends TestCase $this->assertContains( '<thead', $this->centralColumns->getTableHeader( - 'column_heading', __('Click to sort'), 2 + 'column_heading', + __('Click to sort'), + 2 ) ); } @@ -562,7 +595,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT * FROM `pma_central_columns` " . "WHERE db_name = 'phpmyadmin';", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue($this->columnData) @@ -589,7 +624,9 @@ class CentralColumnsTest extends TestCase "SELECT * FROM `pma_central_columns` " . "WHERE db_name = 'phpmyadmin' AND col_name " . "NOT IN ('id','col1','col2');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue($this->columnData) @@ -601,7 +638,6 @@ class CentralColumnsTest extends TestCase 'table1' ) ); - } /** @@ -658,7 +694,9 @@ class CentralColumnsTest extends TestCase ->with( "SELECT * FROM `pma_central_columns` WHERE db_name = 'phpmyadmin'" . " AND col_name IN ('col1');", - null, null, DatabaseInterface::CONNECT_CONTROL + null, + null, + DatabaseInterface::CONNECT_CONTROL ) ->will( $this->returnValue(array_slice($this->columnData, 1, 1)) diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index 3b2eb5fc5d..d1080c1f3d 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -103,7 +103,8 @@ class ConfigFileTest extends PmaTestCase * Case 1: set default value, key should not be persisted */ $this->object->set( - self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $default_simple_value + 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); @@ -340,12 +341,14 @@ class ConfigFileTest extends PmaTestCase self::SIMPLE_KEY_WITH_DEFAULT_VALUE ); $this->assertEquals( - $default_value, $flat_default_config[self::SIMPLE_KEY_WITH_DEFAULT_VALUE] + $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'] + $localhost_value, + $flat_default_config['Servers/1/host'] ); $cfg = []; diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index 8be1271802..3c5e4c1fb6 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -159,8 +159,13 @@ class FormDisplayTemplateTest extends TestCase $opts['comment_warning'] = true; $opts['show_restore_default'] = true; $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'text', 'val', - 'desc', false, $opts + 'test/path', + 'testName', + 'text', + 'val', + 'desc', + false, + $opts ); $this->assertContains( @@ -229,8 +234,13 @@ class FormDisplayTemplateTest extends TestCase $opts['userprefs_allow'] = true; $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'checkbox', 'val', - '', false, $opts + 'test/path', + 'testName', + 'checkbox', + 'val', + '', + false, + $opts ); $this->assertContains( @@ -267,8 +277,13 @@ class FormDisplayTemplateTest extends TestCase $opts['errors'] = []; $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'short_text', 'val', - '', true, $opts + 'test/path', + 'testName', + 'short_text', + 'val', + '', + true, + $opts ); $this->assertContains( @@ -279,8 +294,13 @@ class FormDisplayTemplateTest extends TestCase // number_text $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'number_text', 'val', - '', true, $opts + 'test/path', + 'testName', + 'number_text', + 'val', + '', + true, + $opts ); $this->assertContains( @@ -298,8 +318,13 @@ class FormDisplayTemplateTest extends TestCase 'key2' => false, ]; $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'select', true, - '', true, $opts + 'test/path', + 'testName', + 'select', + true, + '', + true, + $opts ); $this->assertContains( '<select class="all85" name="test/path" id="test/path">', @@ -330,8 +355,13 @@ class FormDisplayTemplateTest extends TestCase 'key2' => false, ]; $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'select', false, - '', true, $opts + 'test/path', + 'testName', + 'select', + false, + '', + true, + $opts ); $this->assertContains( @@ -347,8 +377,13 @@ class FormDisplayTemplateTest extends TestCase // list $result = FormDisplayTemplate::displayInput( - 'test/path', 'testName', 'list', ['foo', 'bar'], - '', true, $opts + 'test/path', + 'testName', + 'list', + ['foo', 'bar'], + '', + true, + $opts ); $this->assertContains( @@ -390,7 +425,6 @@ class FormDisplayTemplateTest extends TestCase '<tr class="group-header group-header-4">', $result ); - } /** @@ -530,7 +564,7 @@ class FormDisplayTemplateTest extends TestCase . '});' . "\n" . 'if (typeof configScriptLoaded !== "undefined"' . ' && configInlineParams) loadInlineConfig();' - . "\n" . '</script>'. "\n", + . "\n" . '</script>' . "\n", $result ); } diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index a6837395b9..23aef22489 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -539,6 +539,5 @@ class FormDisplayTest extends PmaTestCase "maximum 10", $opts['comment'] ); - } } diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index f1bff27f55..c6885f5e9e 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -39,7 +39,10 @@ class FormTest extends PmaTestCase $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['server'] = 0; $this->object = new Form( - 'pma_form_name', ['pma_form1','pma_form2'], new ConfigFile(), 1 + 'pma_form_name', + ['pma_form1','pma_form2'], + new ConfigFile(), + 1 ); } diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 6c50333a5e..f4a068a9b3 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -241,7 +241,6 @@ class ConfigTest extends PmaTestCase '5.0', ], ]; - } @@ -770,7 +769,6 @@ class ConfigTest extends PmaTestCase ); $this->assertEquals($partial_sum, $this->object->getThemeUniqueValue()); - } /** @@ -837,7 +835,6 @@ class ConfigTest extends PmaTestCase 'other' ) ); - } /** @@ -899,7 +896,7 @@ class ConfigTest extends PmaTestCase unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); - file_put_contents('.git/config',''); + file_put_contents('.git/config', ''); $this->assertTrue( $this->object->isGitRevision() @@ -928,7 +925,7 @@ class ConfigTest extends PmaTestCase mkdir($test_dir); chdir($test_dir); - file_put_contents('.git','gitdir: ./.customgitdir'); + file_put_contents('.git', 'gitdir: ./.customgitdir'); $this->assertFalse( $this->object->isGitRevision() ); @@ -945,7 +942,7 @@ class ConfigTest extends PmaTestCase unset($_SESSION['git_location']); unset($_SESSION['is_git_revision']); - file_put_contents('.git','random data here'); + file_put_contents('.git', 'random data here'); $this->assertFalse( $this->object->isGitRevision() @@ -975,7 +972,7 @@ class ConfigTest extends PmaTestCase chdir($test_dir); mkdir('.git'); - file_put_contents('.git/config',''); + file_put_contents('.git/config', ''); $this->object->checkGitRevision(); @@ -983,17 +980,18 @@ class ConfigTest extends PmaTestCase $this->object->get('PMA_VERSION_GIT_COMMITHASH') ); - file_put_contents('.git/HEAD','ref: refs/remotes/origin/master'); + file_put_contents('.git/HEAD', 'ref: refs/remotes/origin/master'); $this->object->checkGitRevision(); $this->assertEmpty( $this->object->get('PMA_VERSION_GIT_COMMITHASH') ); - file_put_contents('.git/packed-refs', - '# pack-refs with: peeled fully-peeled sorted'.PHP_EOL. - 'c1f2ff2eb0c3fda741f859913fd589379f4e4a8f refs/tags/4.3.10'.PHP_EOL. - '^6f2e60343b0a324c65f2d1411bf4bd03e114fb98'.PHP_EOL. - '17bf8b7309919f8ac593d7c563b31472780ee83b refs/remotes/origin/master'.PHP_EOL + file_put_contents( + '.git/packed-refs', + '# pack-refs with: peeled fully-peeled sorted' . PHP_EOL . + 'c1f2ff2eb0c3fda741f859913fd589379f4e4a8f refs/tags/4.3.10' . PHP_EOL . + '^6f2e60343b0a324c65f2d1411bf4bd03e114fb98' . PHP_EOL . + '17bf8b7309919f8ac593d7c563b31472780ee83b refs/remotes/origin/master' . PHP_EOL ); mkdir('.git/objects/pack', 0777, true);//default = 0777, recursive mode $this->object->checkGitRevision(); diff --git a/test/classes/Controllers/Server/ServerDatabasesControllerTest.php b/test/classes/Controllers/Server/ServerDatabasesControllerTest.php index ec0eb6af49..888d5767c4 100644 --- a/test/classes/Controllers/Server/ServerDatabasesControllerTest.php +++ b/test/classes/Controllers/Server/ServerDatabasesControllerTest.php @@ -72,7 +72,8 @@ class ServerDatabasesControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('PhpMyAdmin\Controllers\Server\ServerDatabasesController'); $container->alias( - 'ServerDatabasesController', 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' + 'ServerDatabasesController', + 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' ); $ctrl = $container->get('ServerDatabasesController'); @@ -198,7 +199,8 @@ class ServerDatabasesControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('PhpMyAdmin\Controllers\Server\ServerDatabasesController'); $container->alias( - 'ServerDatabasesController', 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' + 'ServerDatabasesController', + 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' ); $ctrl = $container->get('ServerDatabasesController'); @@ -216,7 +218,8 @@ class ServerDatabasesControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('PhpMyAdmin\Controllers\Server\ServerDatabasesController'); $container->alias( - 'ServerDatabasesController', 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' + 'ServerDatabasesController', + 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' ); $ctrl = $container->get('ServerDatabasesController'); @@ -237,7 +240,8 @@ class ServerDatabasesControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('PhpMyAdmin\Controllers\Server\ServerDatabasesController'); $container->alias( - 'ServerDatabasesController', 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' + 'ServerDatabasesController', + 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' ); $ctrl = $container->get('ServerDatabasesController'); @@ -270,7 +274,8 @@ class ServerDatabasesControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('PhpMyAdmin\Controllers\Server\ServerDatabasesController'); $container->alias( - 'ServerDatabasesController', 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' + 'ServerDatabasesController', + 'PhpMyAdmin\Controllers\Server\ServerDatabasesController' ); $ctrl = $container->get('ServerDatabasesController'); diff --git a/test/classes/Controllers/Table/TableSearchControllerTest.php b/test/classes/Controllers/Table/TableSearchControllerTest.php index fc7b4eada6..15b1295009 100644 --- a/test/classes/Controllers/Table/TableSearchControllerTest.php +++ b/test/classes/Controllers/Table/TableSearchControllerTest.php @@ -109,7 +109,6 @@ class TableSearchControllerTest extends PmaTestCase */ protected function tearDown() { - } /** @@ -135,7 +134,11 @@ class TableSearchControllerTest extends PmaTestCase $useRegex = false; $charSet = "UTF-8"; $tableSearch->replace( - $columnIndex, $find, $replaceWith, $useRegex, $charSet + $columnIndex, + $find, + $replaceWith, + $useRegex, + $charSet ); $sql_query = $GLOBALS['sql_query']; @@ -265,7 +268,8 @@ class TableSearchControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('PhpMyAdmin\Controllers\Table\TableSearchController'); $container->alias( - 'TableSearchController', 'PhpMyAdmin\Controllers\Table\TableSearchController' + 'TableSearchController', + 'PhpMyAdmin\Controllers\Table\TableSearchController' ); $ctrl = $container->get('TableSearchController'); @@ -300,7 +304,8 @@ class TableSearchControllerTest extends PmaTestCase $container = Container::getDefaultContainer(); $container->factory('\PhpMyAdmin\Controllers\Table\TableSearchController'); $container->alias( - 'TableSearchController', 'PhpMyAdmin\Controllers\Table\TableSearchController' + 'TableSearchController', + 'PhpMyAdmin\Controllers\Table\TableSearchController' ); $ctrl = $container->get('TableSearchController'); @@ -379,7 +384,8 @@ class TableSearchControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('\PhpMyAdmin\Controllers\Table\TableSearchController'); $container->alias( - 'TableSearchController', 'PhpMyAdmin\Controllers\Table\TableSearchController' + 'TableSearchController', + 'PhpMyAdmin\Controllers\Table\TableSearchController' ); $ctrl = $container->get('TableSearchController'); diff --git a/test/classes/Controllers/Table/TableStructureControllerTest.php b/test/classes/Controllers/Table/TableStructureControllerTest.php index 3177d364d4..5b2d426382 100644 --- a/test/classes/Controllers/Table/TableStructureControllerTest.php +++ b/test/classes/Controllers/Table/TableStructureControllerTest.php @@ -92,7 +92,8 @@ class TableStructureControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('PhpMyAdmin\Controllers\Table\TableStructureController'); $container->alias( - 'TableStructureController', 'PhpMyAdmin\Controllers\Table\TableStructureController' + 'TableStructureController', + 'PhpMyAdmin\Controllers\Table\TableStructureController' ); $ctrl = $container->get('TableStructureController'); // No primary key in db.table2 @@ -140,7 +141,8 @@ class TableStructureControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('PhpMyAdmin\Controllers\Table\TableStructureController'); $container->alias( - 'TableStructureController', 'PhpMyAdmin\Controllers\Table\TableStructureController' + 'TableStructureController', + 'PhpMyAdmin\Controllers\Table\TableStructureController' ); $ctrl = $container->get('TableStructureController'); // With db.table, it has a primary key `column` @@ -166,7 +168,8 @@ class TableStructureControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('PhpMyAdmin\Controllers\Table\TableStructureController'); $container->alias( - 'TableStructureController', 'PhpMyAdmin\Controllers\Table\TableStructureController' + 'TableStructureController', + 'PhpMyAdmin\Controllers\Table\TableStructureController' ); $ctrl = $container->get('TableStructureController'); @@ -192,7 +195,8 @@ class TableStructureControllerTest extends PmaTestCase $container->set('dbi', $GLOBALS['dbi']); $container->factory('PhpMyAdmin\Controllers\Table\TableStructureController'); $container->alias( - 'TableStructureController', 'PhpMyAdmin\Controllers\Table\TableStructureController' + 'TableStructureController', + 'PhpMyAdmin\Controllers\Table\TableStructureController' ); $ctrl = $container->get('TableStructureController'); @@ -252,7 +256,8 @@ class TableStructureControllerTest extends PmaTestCase $container->set('dbi', $dbi); $container->factory('PhpMyAdmin\Controllers\Table\TableStructureController'); $container->alias( - 'TableStructureController', 'PhpMyAdmin\Controllers\Table\TableStructureController' + 'TableStructureController', + 'PhpMyAdmin\Controllers\Table\TableStructureController' ); $ctrl = $container->get('TableStructureController'); diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index f9efb044de..eea72e99dc 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -150,12 +150,12 @@ class SearchTest extends PmaTestCase public function testGetSearchSqls() { $this->assertEquals( - [ + [ 'select_columns' => 'SELECT * FROM `pma`.`table1` WHERE FALSE', 'select_count' => 'SELECT COUNT(*) AS `count` FROM `pma`.`table1` ' . 'WHERE FALSE', 'delete' => 'DELETE FROM `pma`.`table1` WHERE FALSE' - ], + ], $this->callProtectedFunction( 'getSearchSqls', ['table1'] diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index de0f347b1c..666a9756e6 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -125,7 +125,8 @@ class DatabaseInterfaceTest extends PmaTestCase ]; $column_map = $dbi->getColumnMapFromSql( - $sql_query, $view_columns + $sql_query, + $view_columns ); $this->assertEquals( diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index 43060d0839..4c7192f2ff 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -121,7 +121,10 @@ class ResultsTest extends PmaTestCase * @dataProvider providerForTestGetTableNavigationButton */ public function testGetTableNavigationButton( - $caption, $title, $pos, $html_sql_query + $caption, + $title, + $pos, + $html_sql_query ) { $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons'; $_SESSION[' PMA_token '] = 'token'; @@ -217,8 +220,12 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestGetClassesForColumn */ public function testGetClassesForColumn( - $grid_edit_class, $not_null_class, $relation_class, - $hide_class, $field_type_class, $output + $grid_edit_class, + $not_null_class, + $relation_class, + $hide_class, + $field_type_class, + $output ) { $GLOBALS['cfg']['BrowsePointerEnable'] = true; $GLOBALS['cfg']['BrowseMarkerEnable'] = true; @@ -369,8 +376,14 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetCheckboxForMultiRowSubmissions */ public function testGetCheckboxForMultiRowSubmissions( - $del_url, $displayParts, $row_no, $where_clause_html, $condition_array, - $id_suffix, $class, $output + $del_url, + $displayParts, + $row_no, + $where_clause_html, + $condition_array, + $id_suffix, + $class, + $output ) { $this->assertEquals( $output, @@ -431,7 +444,12 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetEditLink */ public function testGetEditLink( - $edit_url, $class, $edit_str, $where_clause, $where_clause_html, $output + $edit_url, + $class, + $edit_str, + $where_clause, + $where_clause_html, + $output ) { $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; @@ -494,7 +512,12 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetCopyLink */ public function testGetCopyLink( - $copy_url, $copy_str, $where_clause, $where_clause_html, $class, $output + $copy_url, + $copy_str, + $where_clause, + $where_clause_html, + $class, + $output ) { $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; @@ -559,7 +582,11 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetDeleteLink */ public function testGetDeleteLink( - $del_url, $del_str, $js_conf, $class, $output + $del_url, + $del_str, + $js_conf, + $class, + $output ) { $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; @@ -796,9 +823,21 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetCheckboxAndLinks */ public function testGetCheckboxAndLinks( - $position, $del_url, $displayParts, $row_no, $where_clause, - $where_clause_html, $condition_array, $edit_url, - $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output + $position, + $del_url, + $displayParts, + $row_no, + $where_clause, + $where_clause_html, + $condition_array, + $edit_url, + $copy_url, + $class, + $edit_str, + $copy_str, + $del_str, + $js_conf, + $output ) { $this->assertEquals( $output, @@ -892,9 +931,21 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForGetPlacedLinks */ public function testGetPlacedLinks( - $dir, $del_url, $displayParts, $row_no, $where_clause, $where_clause_html, - $condition_array, $edit_url, $copy_url, - $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf, $output + $dir, + $del_url, + $displayParts, + $row_no, + $where_clause, + $where_clause_html, + $condition_array, + $edit_url, + $copy_url, + $edit_anchor_class, + $edit_str, + $copy_str, + $del_str, + $js_conf, + $output ) { $this->assertEquals( $output, @@ -977,7 +1028,12 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestGetSpecialLinkUrl */ public function testGetSpecialLinkUrl( - $db, $table, $column_value, $row_info, $field_name, $output + $db, + $table, + $column_value, + $row_info, + $field_name, + $output ) { $GLOBALS['special_schema_links'] = [ 'information_schema' => [ @@ -1089,7 +1145,11 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestGetRowInfoForSpecialLinks */ public function testGetRowInfoForSpecialLinks( - $fields_meta, $fields_count, $row, $col_order, $output + $fields_meta, + $fields_count, + $row, + $col_order, + $output ) { $this->object->__set('fields_meta', $fields_meta); $this->object->__set('fields_cnt', $fields_count); @@ -1152,7 +1212,12 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestGetShowAllCheckboxForTableNavigation */ public function testGetShowAllCheckboxForTableNavigation( - $db, $table, $goto, $unique_id , $html_sql_query, $output + $db, + $table, + $goto, + $unique_id, + $html_sql_query, + $output ) { $this->object->__set('db', $db); $this->object->__set('table', $table); @@ -1388,9 +1453,17 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestHandleNonPrintableContents */ public function testHandleNonPrintableContents( - $display_binary, $display_blob, $category, $content, - $transformation_plugin, array $transform_options, $default_function, - $meta, $url_params, $is_truncated, $output + $display_binary, + $display_blob, + $category, + $content, + $transformation_plugin, + array $transform_options, + $default_function, + $meta, + $url_params, + $is_truncated, + $output ) { $_SESSION['tmpval']['display_binary'] = $display_binary; $_SESSION['tmpval']['display_blob'] = $display_blob; @@ -1550,10 +1623,21 @@ class ResultsTest extends PmaTestCase * @dataProvider dataProviderForTestGetDataCellForNonNumericColumns */ public function testGetDataCellForNonNumericColumns( - $protectBinary, $column, $class, $meta, $map, - $_url_params, $condition_field, $transformation_plugin, - $default_function, array $transform_options, $is_field_truncated, - $analyzed_sql_results, $dt_result, $col_index, $output + $protectBinary, + $column, + $class, + $meta, + $map, + $_url_params, + $condition_field, + $transformation_plugin, + $default_function, + array $transform_options, + $is_field_truncated, + $analyzed_sql_results, + $dt_result, + $col_index, + $output ) { $_SESSION['tmpval']['display_binary'] = true; $_SESSION['tmpval']['display_blob'] = false; diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index 2e4be43d10..08dd2653aa 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -77,7 +77,9 @@ class EncodingTest extends TestCase $this->assertEquals( 'Only That ecole & Can Be My Blame', Encoding::convertString( - 'UTF-8', 'flat', 'Only That école & Can Be My Blame' + 'UTF-8', + 'flat', + 'Only That école & Can Be My Blame' ) ); } @@ -96,7 +98,9 @@ class EncodingTest extends TestCase $this->assertEquals( "This is the Euro symbol 'EUR'.", Encoding::convertString( - 'UTF-8', 'ISO-8859-1', "This is the Euro symbol '€'." + 'UTF-8', + 'ISO-8859-1', + "This is the Euro symbol '€'." ) ); } @@ -110,7 +114,9 @@ class EncodingTest extends TestCase $this->assertEquals( "This is the Euro symbol '?'.", Encoding::convertString( - 'UTF-8', 'ISO-8859-1', "This is the Euro symbol '€'." + 'UTF-8', + 'ISO-8859-1', + "This is the Euro symbol '€'." ) ); } diff --git a/test/classes/Engines/BdbTest.php b/test/classes/Engines/BdbTest.php index 9221367aa6..d21e4bfd0b 100644 --- a/test/classes/Engines/BdbTest.php +++ b/test/classes/Engines/BdbTest.php @@ -120,6 +120,5 @@ class BdbTest extends PmaTestCase $this->object->getMysqlHelpPage(), 'bdb' ); - } } diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index 5e7fa2f801..5f74d32a96 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -179,10 +179,10 @@ class InnodbTest extends PmaTestCase ); $this->object->support = 2; $this->assertEquals( - [ + [ 'Bufferpool' => 'Buffer Pool', 'Status' => 'InnoDB Status' - ], + ], $this->object->getInfoPages() ); } @@ -286,7 +286,6 @@ class InnodbTest extends PmaTestCase '<pre id="pre_innodb_status">' . "\n" . "\n" . '</pre>' . "\n", $this->object->getPageStatus() ); - } /** @@ -318,7 +317,6 @@ class InnodbTest extends PmaTestCase 'innodb-storage-engine', $this->object->getMysqlHelpPage() ); - } /** @@ -332,7 +330,6 @@ class InnodbTest extends PmaTestCase '1.1.8', $this->object->getInnodbPluginVersion() ); - } /** @@ -345,7 +342,6 @@ class InnodbTest extends PmaTestCase $this->assertFalse( $this->object->supportsFilePerTable() ); - } /** @@ -359,6 +355,5 @@ class InnodbTest extends PmaTestCase 'Antelope', $this->object->getInnodbFileFormat() ); - } } diff --git a/test/classes/Engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php index 88ce5b6e91..98fa797752 100644 --- a/test/classes/Engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -59,6 +59,5 @@ class MrgMyisamTest extends PmaTestCase $this->object->getMysqlHelpPage(), 'merge-storage-engine' ); - } } diff --git a/test/classes/Engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php index b601e91b1a..13131d590c 100644 --- a/test/classes/Engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -99,6 +99,4 @@ class MyisamTest extends PmaTestCase ] ); } - - } diff --git a/test/classes/Engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php index 92bf39ff42..e3c0e7c67e 100644 --- a/test/classes/Engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -88,6 +88,5 @@ class NdbclusterTest extends PmaTestCase $this->object->getMysqlHelpPage(), 'ndbcluster' ); - } } diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index 8b6a89f80a..945a8e7115 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -200,21 +200,21 @@ class PbxtTest extends PmaTestCase [ 0 => '8,192', 1 => 'KiB' - ] + ] ], [ '10mb', [ 0 => '-1', 1 => 'B' - ] + ] ], [ 'A4', [ 0 => '0', 1 => 'B' - ] + ] ] ]; } diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index cb227d6ec5..4efa6aaf3d 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -108,7 +108,12 @@ class ErrorHandlerTest extends PmaTestCase * @dataProvider providerForTestHandleError */ public function testGetDispErrorsForDisplayFalse( - $errno, $errstr, $errfile, $errline, $output_show, $output_hide + $errno, + $errstr, + $errfile, + $errline, + $output_show, + $output_hide ) { // TODO: Add other test cases for all combination of 'sendErrorReports' $GLOBALS['cfg']['SendErrorReports'] = 'never'; @@ -141,7 +146,12 @@ class ErrorHandlerTest extends PmaTestCase * @dataProvider providerForTestHandleError */ public function testGetDispErrorsForDisplayTrue( - $errno, $errstr, $errfile, $errline, $output_show, $output_hide + $errno, + $errstr, + $errfile, + $errline, + $output_show, + $output_hide ) { $this->object->handleError($errno, $errstr, $errfile, $errline); @@ -149,7 +159,6 @@ class ErrorHandlerTest extends PmaTestCase $output_show, $this->object->getDispErrors() ); - } /** @@ -179,7 +188,10 @@ class ErrorHandlerTest extends PmaTestCase public function testCountErrors() { $this->object->addError( - 'Compile Error', E_WARNING, 'error.txt', 15 + 'Compile Error', + E_WARNING, + 'error.txt', + 15 ); $this->assertEquals( 1, @@ -197,7 +209,10 @@ class ErrorHandlerTest extends PmaTestCase public function testSliceErrors() { $this->object->addError( - 'Compile Error', E_WARNING, 'error.txt', 15 + 'Compile Error', + E_WARNING, + 'error.txt', + 15 ); $this->assertEquals( 1, @@ -229,14 +244,20 @@ class ErrorHandlerTest extends PmaTestCase public function testCountUserErrors() { $this->object->addError( - 'Compile Error', E_WARNING, 'error.txt', 15 + 'Compile Error', + E_WARNING, + 'error.txt', + 15 ); $this->assertEquals( 0, $this->object->countUserErrors() ); $this->object->addError( - 'Compile Error', E_USER_WARNING, 'error.txt', 15 + 'Compile Error', + E_USER_WARNING, + 'error.txt', + 15 ); $this->assertEquals( 1, diff --git a/test/classes/FontTest.php b/test/classes/FontTest.php index c4db328d0f..39a959241a 100644 --- a/test/classes/FontTest.php +++ b/test/classes/FontTest.php @@ -185,7 +185,6 @@ class FontTest extends PmaTestCase 73, $this->font->getStringWidth("phpMyAdmin", "broadway", 10) ); - } /** @@ -238,7 +237,9 @@ class FontTest extends PmaTestCase $this->assertEquals( 6, $this->font->getStringWidth( - "a", "arial", 10, + "a", + "arial", + 10, [["chars" => "a"]] ) ); @@ -248,7 +249,9 @@ class FontTest extends PmaTestCase $this->assertEquals( 6, $this->font->getStringWidth( - "a", "arial", 10, + "a", + "arial", + 10, [["modifier" => 0.61]] ) ); @@ -258,7 +261,9 @@ class FontTest extends PmaTestCase $this->assertEquals( 6, $this->font->getStringWidth( - "a", "arial", 10, + "a", + "arial", + 10, [["chars" => "a", "modifier" => 0.61]] ) ); @@ -267,7 +272,9 @@ class FontTest extends PmaTestCase $this->assertEquals( 7, $this->font->getStringWidth( - "a", "arial", 10, + "a", + "arial", + 10, [["chars" => ["a"], "modifier" => 0.61]] ) ); diff --git a/test/classes/Gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php index 71cb71b99a..29b9ea57ff 100644 --- a/test/classes/Gis/GisGeometryCollectionTest.php +++ b/test/classes/Gis/GisGeometryCollectionTest.php @@ -194,10 +194,18 @@ class GisGeometryCollectionTest extends TestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $line_color, $scale_data, $image + $spatial, + $label, + $line_color, + $scale_data, + $image ) { $return = $this->object->prepareRowAsPng( - $spatial, $label, $line_color, $scale_data, $image + $spatial, + $label, + $line_color, + $scale_data, + $image ); $this->assertEquals(120, imagesx($return)); $this->assertEquals(150, imagesy($return)); @@ -244,10 +252,18 @@ class GisGeometryCollectionTest extends TestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $line_color, $scale_data, $pdf + $spatial, + $label, + $line_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $line_color, $scale_data, $pdf + $spatial, + $label, + $line_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -290,16 +306,26 @@ class GisGeometryCollectionTest extends TestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $line_color, $scale_data, $output + $spatial, + $label, + $line_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $line_color, $scale_data + $spatial, + $label, + $line_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); $this->assertRegExp( $output, $this->object->prepareRowAsSvg( - $spatial, $label, $line_color, $scale_data + $spatial, + $label, + $line_color, + $scale_data ) ); } @@ -346,12 +372,21 @@ class GisGeometryCollectionTest extends TestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $line_color, $scale_data, $output + $spatial, + $srid, + $label, + $line_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $line_color, $scale_data + $spatial, + $srid, + $label, + $line_color, + $scale_data ) ); } diff --git a/test/classes/Gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php index f23eb334cc..95bf1d3246 100644 --- a/test/classes/Gis/GisLineStringTest.php +++ b/test/classes/Gis/GisLineStringTest.php @@ -177,11 +177,19 @@ class GisLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng * @return void */ - public function testPrepareRowAsPng($spatial, $label, $line_color, - $scale_data, $image + public function testPrepareRowAsPng( + $spatial, + $label, + $line_color, + $scale_data, + $image ) { $this->object->prepareRowAsPng( - $spatial, $label, $line_color, $scale_data, $image + $spatial, + $label, + $line_color, + $scale_data, + $image ); /* TODO: this never fails */ $this->assertTrue(true); @@ -225,11 +233,19 @@ class GisLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf * @return void */ - public function testPrepareRowAsPdf($spatial, $label, $line_color, - $scale_data, $pdf + public function testPrepareRowAsPdf( + $spatial, + $label, + $line_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $line_color, $scale_data, $pdf + $spatial, + $label, + $line_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -269,11 +285,18 @@ class GisLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg * @return void */ - public function testPrepareRowAsSvg($spatial, $label, $line_color, - $scale_data, $output + public function testPrepareRowAsSvg( + $spatial, + $label, + $line_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $line_color, $scale_data + $spatial, + $label, + $line_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); } @@ -316,12 +339,21 @@ class GisLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl * @return void */ - public function testPrepareRowAsOl($spatial, $srid, $label, - $line_color, $scale_data, $output + public function testPrepareRowAsOl( + $spatial, + $srid, + $label, + $line_color, + $scale_data, + $output ) { $this->assertEquals( $this->object->prepareRowAsOl( - $spatial, $srid, $label, $line_color, $scale_data + $spatial, + $srid, + $label, + $line_color, + $scale_data ), $output ); diff --git a/test/classes/Gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php index 555791e4af..9a79f2905a 100644 --- a/test/classes/Gis/GisMultiLineStringTest.php +++ b/test/classes/Gis/GisMultiLineStringTest.php @@ -239,10 +239,18 @@ class GisMultiLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $line_color, $scale_data, $image + $spatial, + $label, + $line_color, + $scale_data, + $image ) { $this->object->prepareRowAsPng( - $spatial, $label, $line_color, $scale_data, $image + $spatial, + $label, + $line_color, + $scale_data, + $image ); /* TODO: this never fails */ $this->assertTrue(true); @@ -287,10 +295,18 @@ class GisMultiLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $line_color, $scale_data, $pdf + $spatial, + $label, + $line_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $line_color, $scale_data, $pdf + $spatial, + $label, + $line_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -331,10 +347,17 @@ class GisMultiLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $line_color, $scale_data, $output + $spatial, + $label, + $line_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $line_color, $scale_data + $spatial, + $label, + $line_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); } @@ -380,12 +403,21 @@ class GisMultiLineStringTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $line_color, $scale_data, $output + $spatial, + $srid, + $label, + $line_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $line_color, $scale_data + $spatial, + $srid, + $label, + $line_color, + $scale_data ) ); } diff --git a/test/classes/Gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php index b976895b58..43d02fce3e 100644 --- a/test/classes/Gis/GisMultiPointTest.php +++ b/test/classes/Gis/GisMultiPointTest.php @@ -183,10 +183,18 @@ class GisMultiPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $point_color, $scale_data, $image + $spatial, + $label, + $point_color, + $scale_data, + $image ) { $return = $this->object->prepareRowAsPng( - $spatial, $label, $point_color, $scale_data, $image + $spatial, + $label, + $point_color, + $scale_data, + $image ); $this->assertImage($return); } @@ -230,10 +238,18 @@ class GisMultiPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $point_color, $scale_data, $pdf + $spatial, + $label, + $point_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $point_color, $scale_data, $pdf + $spatial, + $label, + $point_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -274,10 +290,17 @@ class GisMultiPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $point_color, $scale_data, $output + $spatial, + $label, + $point_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $point_color, $scale_data + $spatial, + $label, + $point_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); } @@ -329,12 +352,21 @@ class GisMultiPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $point_color, $scale_data, $output + $spatial, + $srid, + $label, + $point_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $point_color, $scale_data + $spatial, + $srid, + $label, + $point_color, + $scale_data ) ); } diff --git a/test/classes/Gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php index 0e613adc1d..80f38e7428 100644 --- a/test/classes/Gis/GisMultiPolygonTest.php +++ b/test/classes/Gis/GisMultiPolygonTest.php @@ -283,10 +283,18 @@ class GisMultiPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $fill_color, $scale_data, $image + $spatial, + $label, + $fill_color, + $scale_data, + $image ) { $return = $this->object->prepareRowAsPng( - $spatial, $label, $fill_color, $scale_data, $image + $spatial, + $label, + $fill_color, + $scale_data, + $image ); $this->assertImage($return); } @@ -332,10 +340,18 @@ class GisMultiPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $fill_color, $scale_data, $pdf + $spatial, + $label, + $fill_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $fill_color, $scale_data, $pdf + $spatial, + $label, + $fill_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -377,10 +393,17 @@ class GisMultiPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $fill_color, $scale_data, $output + $spatial, + $label, + $fill_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $fill_color, $scale_data + $spatial, + $label, + $fill_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); } @@ -429,12 +452,21 @@ class GisMultiPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $fill_color, $scale_data, $output + $spatial, + $srid, + $label, + $fill_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $fill_color, $scale_data + $spatial, + $srid, + $label, + $fill_color, + $scale_data ) ); } diff --git a/test/classes/Gis/GisPointTest.php b/test/classes/Gis/GisPointTest.php index 73a22561d7..ec74758af5 100644 --- a/test/classes/Gis/GisPointTest.php +++ b/test/classes/Gis/GisPointTest.php @@ -184,10 +184,18 @@ class GisPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $point_color, $scale_data, $image + $spatial, + $label, + $point_color, + $scale_data, + $image ) { $return = $this->object->prepareRowAsPng( - $spatial, $label, $point_color, $scale_data, $image + $spatial, + $label, + $point_color, + $scale_data, + $image ); $this->assertImage($return); } @@ -231,10 +239,18 @@ class GisPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $point_color, $scale_data, $pdf + $spatial, + $label, + $point_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $point_color, $scale_data, $pdf + $spatial, + $label, + $point_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -275,12 +291,19 @@ class GisPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $point_color, $scale_data, $output + $spatial, + $label, + $point_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsSvg( - $spatial, $label, $point_color, $scale_data + $spatial, + $label, + $point_color, + $scale_data ) ); } @@ -322,12 +345,21 @@ class GisPointTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $point_color, $scale_data, $output + $spatial, + $srid, + $label, + $point_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $point_color, $scale_data + $spatial, + $srid, + $label, + $point_color, + $scale_data ) ); } diff --git a/test/classes/Gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php index e75a9cbed8..d5ac64bd3a 100644 --- a/test/classes/Gis/GisPolygonTest.php +++ b/test/classes/Gis/GisPolygonTest.php @@ -371,10 +371,18 @@ class GisPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPng */ public function testPrepareRowAsPng( - $spatial, $label, $fill_color, $scale_data, $image + $spatial, + $label, + $fill_color, + $scale_data, + $image ) { $return = $this->object->prepareRowAsPng( - $spatial, $label, $fill_color, $scale_data, $image + $spatial, + $label, + $fill_color, + $scale_data, + $image ); $this->assertImage($return); } @@ -418,10 +426,18 @@ class GisPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsPdf */ public function testPrepareRowAsPdf( - $spatial, $label, $fill_color, $scale_data, $pdf + $spatial, + $label, + $fill_color, + $scale_data, + $pdf ) { $return = $this->object->prepareRowAsPdf( - $spatial, $label, $fill_color, $scale_data, $pdf + $spatial, + $label, + $fill_color, + $scale_data, + $pdf ); $this->assertInstanceOf('TCPDF', $return); } @@ -462,10 +478,17 @@ class GisPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsSvg */ public function testPrepareRowAsSvg( - $spatial, $label, $fill_color, $scale_data, $output + $spatial, + $label, + $fill_color, + $scale_data, + $output ) { $string = $this->object->prepareRowAsSvg( - $spatial, $label, $fill_color, $scale_data + $spatial, + $label, + $fill_color, + $scale_data ); $this->assertEquals(1, preg_match($output, $string)); } @@ -510,12 +533,21 @@ class GisPolygonTest extends GisGeomTestCase * @dataProvider providerForPrepareRowAsOl */ public function testPrepareRowAsOl( - $spatial, $srid, $label, $fill_color, $scale_data, $output + $spatial, + $srid, + $label, + $fill_color, + $scale_data, + $output ) { $this->assertEquals( $output, $this->object->prepareRowAsOl( - $spatial, $srid, $label, $fill_color, $scale_data + $spatial, + $srid, + $label, + $fill_color, + $scale_data ) ); } diff --git a/test/classes/IndexTest.php b/test/classes/IndexTest.php index d3ac4e2400..5483033c30 100644 --- a/test/classes/IndexTest.php +++ b/test/classes/IndexTest.php @@ -95,7 +95,6 @@ class IndexTest extends PmaTestCase 'PMA_Index_choice', $index->getChoice() ); - } /** diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 9a6b881aac..a4c805cf72 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -103,7 +103,11 @@ class InsertEditTest extends TestCase $GLOBALS['goto'] = 'index.php'; $result = $this->insertEdit->getFormParametersForInsertForm( - 'dbname', 'tablename', [], $where_clause, 'localhost' + 'dbname', + 'tablename', + [], + $where_clause, + 'localhost' ); $this->assertEquals( @@ -1546,7 +1550,10 @@ class InsertEditTest extends TestCase $_POST['sql_query'] = "SELECT 1"; $result = $this->insertEdit->getContinueInsertionForm( - "tbl", "db", $where_clause_array, "localhost" + "tbl", + "db", + $where_clause_array, + "localhost" ); $this->assertContains( @@ -2429,8 +2436,13 @@ class InsertEditTest extends TestCase 'transformation_options' => "'','option ,, quoted',abd" ]; $result = $this->insertEdit->transformEditedValues( - 'db', 'table', $transformation, $edited_values, - 'Text_Plain_PreApPend.php', 'c', ['a' => 'b'], + 'db', + 'table', + $transformation, + $edited_values, + 'Text_Plain_PreApPend.php', + 'c', + ['a' => 'b'], 'transformation' ); @@ -2450,8 +2462,18 @@ class InsertEditTest extends TestCase $multi_edit_columns_name = ['0' => 'fld']; $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit( - $multi_edit_columns_name, [], '', [], [], true, [1], - [2], 'foo', [], '0', [] + $multi_edit_columns_name, + [], + '', + [], + [], + true, + [1], + [2], + 'foo', + [], + '0', + [] ); $this->assertEquals( @@ -2463,8 +2485,18 @@ class InsertEditTest extends TestCase ); $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit( - $multi_edit_columns_name, [], '', [], [], false, [1], - [2], 'foo', [], '0', ['a'] + $multi_edit_columns_name, + [], + '', + [], + [], + false, + [1], + [2], + 'foo', + [], + '0', + ['a'] ); $this->assertEquals( @@ -2476,8 +2508,18 @@ class InsertEditTest extends TestCase ); $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit( - $multi_edit_columns_name, ['b'], "'`c`'", ['c'], [], - false, [1], [2], 'foo', [], '0', ['a'] + $multi_edit_columns_name, + ['b'], + "'`c`'", + ['c'], + [], + false, + [1], + [2], + 'foo', + [], + '0', + ['a'] ); $this->assertEquals( @@ -2489,8 +2531,18 @@ class InsertEditTest extends TestCase ); $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit( - $multi_edit_columns_name, ['b'], "'`c`'", ['c'], [3], - false, [1], [2], 'foo', [], 0, [] + $multi_edit_columns_name, + ['b'], + "'`c`'", + ['c'], + [3], + false, + [1], + [2], + 'foo', + [], + 0, + [] ); $this->assertEquals( @@ -2510,8 +2562,14 @@ class InsertEditTest extends TestCase public function testGetCurrentValueAsAnArrayForMultipleEdit() { $result = $this->insertEdit->getCurrentValueAsAnArrayForMultipleEdit( - [], [], [], 'currVal', [], - [], [], '0' + [], + [], + [], + 'currVal', + [], + [], + [], + '0' ); $this->assertEquals('currVal', $result); @@ -2532,8 +2590,14 @@ class InsertEditTest extends TestCase $this->insertEdit = new InsertEdit($GLOBALS['dbi']); $result = $this->insertEdit->getCurrentValueAsAnArrayForMultipleEdit( - $multi_edit_funcs, [], [], 'currVal', [], - [], [], '0' + $multi_edit_funcs, + [], + [], + 'currVal', + [], + [], + [], + '0' ); $this->assertEquals("'uuid1234'", $result); @@ -2542,8 +2606,14 @@ class InsertEditTest extends TestCase $multi_edit_funcs = ['AES_ENCRYPT']; $multi_edit_salt = [""]; $result = $this->insertEdit->getCurrentValueAsAnArrayForMultipleEdit( - $multi_edit_funcs, $multi_edit_salt, [], "'''", [], - ['func'], ['func'], '0' + $multi_edit_funcs, + $multi_edit_salt, + [], + "'''", + [], + ['func'], + ['func'], + '0' ); $this->assertEquals("AES_ENCRYPT(''','')", $result); @@ -2551,15 +2621,27 @@ class InsertEditTest extends TestCase $multi_edit_funcs = ['func']; $multi_edit_salt = []; $result = $this->insertEdit->getCurrentValueAsAnArrayForMultipleEdit( - $multi_edit_funcs, $multi_edit_salt, [], "'''", [], - ['func'], ['func'], '0' + $multi_edit_funcs, + $multi_edit_salt, + [], + "'''", + [], + ['func'], + ['func'], + '0' ); $this->assertEquals("func(''')", $result); // case 5 $result = $this->insertEdit->getCurrentValueAsAnArrayForMultipleEdit( - $multi_edit_funcs, $multi_edit_salt, [], "''", [], - ['func'], ['func'], '0' + $multi_edit_funcs, + $multi_edit_salt, + [], + "''", + [], + ['func'], + ['func'], + '0' ); $this->assertEquals("func()", $result); } @@ -2593,8 +2675,20 @@ class InsertEditTest extends TestCase $this->insertEdit = new InsertEdit($GLOBALS['dbi']); $result = $this->insertEdit->getCurrentValueForDifferentTypes( - '123', '0', [], '', [], 0, [], [], - [], true, true, '1', 'table', [] + '123', + '0', + [], + '', + [], + 0, + [], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2604,8 +2698,20 @@ class InsertEditTest extends TestCase // case 2 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['test'], '', [1], 0, [], [], - [], true, true, '1', 'table', [] + false, + '0', + ['test'], + '', + [1], + 0, + [], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2615,8 +2721,20 @@ class InsertEditTest extends TestCase // case 3 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['test'], '', [], 0, [], [], - [], true, true, '1', 'table', [] + false, + '0', + ['test'], + '', + [], + 0, + [], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2627,8 +2745,20 @@ class InsertEditTest extends TestCase // case 4 $_REQUEST['fields']['multi_edit'][0][0] = []; $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['set'], '', [], 0, [], [], - [], true, true, '1', 'table', [] + false, + '0', + ['set'], + '', + [], + 0, + [], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2638,8 +2768,20 @@ class InsertEditTest extends TestCase // case 5 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['protected'], '', [], 0, ['a'], [], - [], true, true, '1', 'table', [] + false, + '0', + ['protected'], + '', + [], + 0, + ['a'], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2649,8 +2791,20 @@ class InsertEditTest extends TestCase // case 6 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['protected'], '', [], 0, ['a'], [], - [], true, true, '1', 'table', [] + false, + '0', + ['protected'], + '', + [], + 0, + ['a'], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2660,8 +2814,20 @@ class InsertEditTest extends TestCase // case 7 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['bit'], '20\'12', [], 0, ['a'], [], - [], true, true, '1', 'table', [] + false, + '0', + ['bit'], + '20\'12', + [], + 0, + ['a'], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2671,8 +2837,20 @@ class InsertEditTest extends TestCase // case 7 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['date'], '20\'12', [], 0, ['a'], [], - [], true, true, '1', 'table', [] + false, + '0', + ['date'], + '20\'12', + [], + 0, + ['a'], + [], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2683,8 +2861,20 @@ class InsertEditTest extends TestCase // case 8 $_REQUEST['fields']['multi_edit'][0][0] = []; $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['set'], '', [], 0, [], [1], - [], true, true, '1', 'table', [] + false, + '0', + ['set'], + '', + [], + 0, + [], + [1], + [], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2694,8 +2884,20 @@ class InsertEditTest extends TestCase // case 9 $result = $this->insertEdit->getCurrentValueForDifferentTypes( - false, '0', ['protected'], '', [], 0, ['a'], [], - [1], true, true, '1', 'table', [] + false, + '0', + ['protected'], + '', + [], + 0, + ['a'], + [], + [1], + true, + true, + '1', + 'table', + [] ); $this->assertEquals( @@ -2771,24 +2973,34 @@ class InsertEditTest extends TestCase $this->insertEdit = new InsertEdit($GLOBALS['dbi']); $this->insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData( - 'db', 'table', 'a', $extra_data + 'db', + 'table', + 'a', + $extra_data ); $this->assertFalse($extra_data['isNeedToRecheck']); $this->insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData( - 'db', 'table', 'a', $extra_data + 'db', + 'table', + 'a', + $extra_data ); $this->assertEquals('123', $extra_data['truncatableFieldValue']); $this->assertTrue($extra_data['isNeedToRecheck']); $this->insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData( - 'db', 'table', 'a', $extra_data + 'db', + 'table', + 'a', + $extra_data ); $this->assertEquals( - '2013-08-28 06:34:14.000000', $extra_data['truncatableFieldValue'] + '2013-08-28 06:34:14.000000', + $extra_data['truncatableFieldValue'] ); $this->assertTrue($extra_data['isNeedToRecheck']); } @@ -3117,10 +3329,32 @@ class InsertEditTest extends TestCase ] ]; $actual = $this->insertEdit->getHtmlForInsertEditRow( - [], $table_columns, [], false, [], '', '', - '', false, [], $o_rows, $tabindex, 1, false, 0, - [], 0, 0, 'table', 'db', 0, [], 0, '', - [], ['wc'] + [], + $table_columns, + [], + false, + [], + '', + '', + '', + false, + [], + $o_rows, + $tabindex, + 1, + false, + 0, + [], + 0, + 0, + 'table', + 'db', + 0, + [], + 0, + '', + [], + ['wc'] ); $this->assertContains( 'test', @@ -3181,10 +3415,32 @@ class InsertEditTest extends TestCase ] ]; $actual = $this->insertEdit->getHtmlForInsertEditRow( - [], $table_columns, [], false, [], '', '', - '', false, [], $o_rows, $tabindex, 1, false, 0, - [], 0, 0, 'table', 'db', 0, [], 0, '', - [], ['wc'] + [], + $table_columns, + [], + false, + [], + '', + '', + '', + false, + [], + $o_rows, + $tabindex, + 1, + false, + 0, + [], + 0, + 0, + 'table', + 'db', + 0, + [], + 0, + '', + [], + ['wc'] ); $this->assertContains( 'foo', @@ -3217,10 +3473,32 @@ class InsertEditTest extends TestCase ] ]; $actual = $this->insertEdit->getHtmlForInsertEditRow( - [], $table_columns, [], false, [], '', '', - '', true, [], $o_rows, $tabindex, 2, false, 0, - [], 0, 0, 'table', 'db', 0, [], 0, '', - [], ['wc'] + [], + $table_columns, + [], + false, + [], + '', + '', + '', + true, + [], + $o_rows, + $tabindex, + 2, + false, + 0, + [], + 0, + 0, + 'table', + 'db', + 0, + [], + 0, + '', + [], + ['wc'] ); $this->assertContains( 'foo', @@ -3228,7 +3506,7 @@ class InsertEditTest extends TestCase ); $this->assertContains( '<textarea name="fields[37b51d194a7513e45b56f6524f2d51f2]" ' - .'class="" readonly="readonly"', + . 'class="" readonly="readonly"', $actual ); } diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 95d5d0d9a2..dc6384719f 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -101,7 +101,7 @@ class LanguageTest extends PmaTestCase $this->assertGreaterThan(1, count($langs)); /* Ensure we have name for every language */ - foreach($langs as $lang) { + foreach ($langs as $lang) { $this->assertNotEquals($lang->getCode(), strtolower($lang->getEnglishName())); } } diff --git a/test/classes/ListDatabaseTest.php b/test/classes/ListDatabaseTest.php index b1395abdef..9d630ca50a 100644 --- a/test/classes/ListDatabaseTest.php +++ b/test/classes/ListDatabaseTest.php @@ -122,5 +122,4 @@ class ListDatabaseTest extends PmaTestCase 'mysql' ); } - } diff --git a/test/classes/MessageTest.php b/test/classes/MessageTest.php index 23f019e52a..fe5a132b49 100644 --- a/test/classes/MessageTest.php +++ b/test/classes/MessageTest.php @@ -453,7 +453,6 @@ class MessageTest extends PmaTestCase 'test string', Message::format('%s string', ['test']) ); - } /** diff --git a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index a3a17afc7c..2caacf2a76 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -41,7 +41,8 @@ class NodeDatabaseChildTest extends PmaTestCase $_SESSION['relation'][1]['PMA_VERSION'] = PMA_VERSION; $_SESSION['relation'][1]['navwork'] = true; $this->object = $this->getMockForAbstractClass( - 'PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild', ['child'] + 'PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild', + ['child'] ); } diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index d2b6988c6d..fe4c59bfa6 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -101,7 +101,9 @@ class NodeTest extends PmaTestCase { $parent = NodeFactory::getInstance(); $empty_container = NodeFactory::getInstance( - 'Node', 'empty', Node::CONTAINER + 'Node', + 'empty', + Node::CONTAINER ); $child = NodeFactory::getInstance(); // test with no children @@ -155,7 +157,9 @@ class NodeTest extends PmaTestCase $this->assertEquals($parent->numChildren(), 1); // add a container, this one doesn't count wither $container = NodeFactory::getInstance( - 'Node', 'default', Node::CONTAINER + 'Node', + 'default', + Node::CONTAINER ); $parent->addChild($container); $this->assertEquals($parent->numChildren(), 1); @@ -239,7 +243,9 @@ class NodeTest extends PmaTestCase $firstChild = NodeFactory::getInstance(); $parent->addChild($firstChild); $secondChild = NodeFactory::getInstance( - 'Node', 'default', Node::CONTAINER + 'Node', + 'default', + Node::CONTAINER ); $parent->addChild($secondChild); // Empty Node::CONTAINER type node should not be considered in hasSiblings() @@ -283,14 +289,16 @@ class NodeTest extends PmaTestCase public function testGetWhereClause() { $method = new ReflectionMethod( - 'PhpMyAdmin\Navigation\Nodes\Node', '_getWhereClause' + 'PhpMyAdmin\Navigation\Nodes\Node', + '_getWhereClause' ); $method->setAccessible(true); // Vanilla case $node = NodeFactory::getInstance(); $this->assertEquals( - "WHERE TRUE ", $method->invoke($node, 'SCHEMA_NAME') + "WHERE TRUE ", + $method->invoke($node, 'SCHEMA_NAME') ); // When a schema names is passed as search clause diff --git a/test/classes/OperationsTest.php b/test/classes/OperationsTest.php index d1c0e65771..8be406aad2 100644 --- a/test/classes/OperationsTest.php +++ b/test/classes/OperationsTest.php @@ -125,10 +125,12 @@ class OperationsTest extends TestCase $_REQUEST['db_collation'] = 'db1'; $result = $this->operations->getHtmlForChangeDatabaseCharset("pma", "bookmark"); $this->assertRegExp( - '/.*select_db_collation.*Collation.*/m', $result + '/.*select_db_collation.*Collation.*/m', + $result ); $this->assertRegExp( - '/.*db_operations.php.*/', $result + '/.*db_operations.php.*/', + $result ); } @@ -198,7 +200,8 @@ class OperationsTest extends TestCase $this->assertRegExp( '/.*Delete data or table.*Empty the table.*Delete the table.*/m', $this->operations->getHtmlForDeleteDataOrTable( - ["truncate" => 'foo'], ["drop" => 'bar'] + ["truncate" => 'foo'], + ["drop" => 'bar'] ) ); } @@ -260,6 +263,4 @@ class OperationsTest extends TestCase ) ); } - - } diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index a3909840f5..e19e91aeb9 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -618,7 +618,6 @@ class AuthenticationCookieTest extends PmaTestCase '', $this->object->password ); - } /** @@ -705,7 +704,6 @@ class AuthenticationCookieTest extends PmaTestCase $arr, $GLOBALS['cfg']['Server'] ); - } /** @@ -769,7 +767,6 @@ class AuthenticationCookieTest extends PmaTestCase 'Login without a password is forbidden by configuration' . ' (see AllowNoPassword)' ); - } /** @@ -1112,9 +1109,9 @@ class AuthenticationCookieTest extends PmaTestCase $method->setAccessible(true); $encryptedCookie = $this->object->cookieEncrypt( - json_encode($payload), - $method->invoke($this->object, null) - ); + json_encode($payload), + $method->invoke($this->object, null) + ); $this->assertEquals( $_COOKIE['pmaAuth-' . $GLOBALS['server']], $encryptedCookie diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index 5f1da34acf..1cc60ad1c7 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -136,7 +136,9 @@ class AuthenticationHttpTest extends PmaTestCase $GLOBALS['cfg']['Server']['LogoutURL'] = 'https://example.com/logout'; $this->doMockResponse( - 0, 0, 0, + 0, + 0, + 0, ['Location: https://example.com/logout'] ); } @@ -150,7 +152,9 @@ class AuthenticationHttpTest extends PmaTestCase $GLOBALS['cfg']['Server']['verbose'] = 'verboseMessagê'; $this->doMockResponse( - 1, 1, 1, + 1, + 1, + 1, ['WWW-Authenticate: Basic realm="phpMyAdmin verboseMessag"'], ['status: 401 Unauthorized'], 401 @@ -166,7 +170,9 @@ class AuthenticationHttpTest extends PmaTestCase $GLOBALS['cfg']['Server']['host'] = 'hòst'; $this->doMockResponse( - 1, 1, 1, + 1, + 1, + 1, ['WWW-Authenticate: Basic realm="phpMyAdmin hst"'], ['status: 401 Unauthorized'], 401 @@ -182,7 +188,9 @@ class AuthenticationHttpTest extends PmaTestCase $GLOBALS['cfg']['Server']['auth_http_realm'] = 'rêäealmmessage'; $this->doMockResponse( - 1, 1, 1, + 1, + 1, + 1, ['WWW-Authenticate: Basic realm="realmmessage"'], ['status: 401 Unauthorized'], 401 @@ -204,8 +212,15 @@ class AuthenticationHttpTest extends PmaTestCase * @return void * @dataProvider readCredentialsProvider */ - public function testAuthCheck($user, $pass, $userIndex, $passIndex, - $expectedReturn, $expectedUser, $expectedPass, $old_usr = '' + public function testAuthCheck( + $user, + $pass, + $userIndex, + $passIndex, + $expectedReturn, + $expectedUser, + $expectedPass, + $old_usr = '' ) { $_SERVER[$userIndex] = $user; $_SERVER[$passIndex] = $pass; diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index 196083687d..af50d3f8c8 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -255,7 +255,11 @@ class ExportCodegenTest extends PmaTestCase ob_start(); $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ); $result = ob_get_clean(); @@ -282,7 +286,11 @@ class ExportCodegenTest extends PmaTestCase $GLOBALS['codegen_format'] = 4; $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ); $this->expectOutputString( diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index 41c8ffbdbe..45d1757a08 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -243,7 +243,6 @@ class ExportCsvTest extends PmaTestCase 'structure_or_data', $property->getName() ); - } /** @@ -497,7 +496,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertFalse( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); @@ -544,7 +547,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); @@ -591,7 +598,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); @@ -641,7 +652,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); @@ -690,7 +705,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); @@ -738,7 +757,11 @@ class ExportCsvTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 85a713eac1..de94ef29b3 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -201,5 +201,4 @@ class ExportExcelTest extends PmaTestCase $property->getName() ); } - } diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index 93922c1392..b7d9480ca1 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -376,7 +376,11 @@ class ExportHtmlwordTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'testDB', 'testTable', "\n", 'example.com', 'test' + 'testDB', + 'testTable', + "\n", + 'example.com', + 'test' ) ); $result = htmlspecialchars_decode(ob_get_clean()); @@ -810,7 +814,12 @@ class ExportHtmlwordTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 'tbl', "\n", "example.com", "create_table", "test" + 'db', + 'tbl', + "\n", + "example.com", + "create_table", + "test" ) ); $result = ob_get_clean(); @@ -823,7 +832,12 @@ class ExportHtmlwordTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 'tbl', "\n", "example.com", "triggers", "test" + 'db', + 'tbl', + "\n", + "example.com", + "triggers", + "test" ) ); $result = ob_get_clean(); @@ -836,7 +850,12 @@ class ExportHtmlwordTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 'tbl', "\n", "example.com", "create_view", "test" + 'db', + 'tbl', + "\n", + "example.com", + "create_view", + "test" ) ); $result = ob_get_clean(); @@ -849,7 +868,12 @@ class ExportHtmlwordTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 'tbl', "\n", "example.com", "stand_in", "test" + 'db', + 'tbl', + "\n", + "example.com", + "stand_in", + "test" ) ); $result = ob_get_clean(); @@ -868,7 +892,8 @@ class ExportHtmlwordTest extends PmaTestCase public function testFormatOneColumnDefinition() { $method = new ReflectionMethod( - 'PhpMyAdmin\Plugins\Export\ExportHtmlword', 'formatOneColumnDefinition' + 'PhpMyAdmin\Plugins\Export\ExportHtmlword', + 'formatOneColumnDefinition' ); $method->setAccessible(true); diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index b757860e59..7403b83016 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -128,7 +128,6 @@ class ExportJsonTest extends PmaTestCase 'structure_or_data', $property->getName() ); - } /** diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index dec60dbb39..b06f540dd9 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -298,7 +298,12 @@ class ExportMediawikiTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 'table', "\n", "example.com", "create_table", "test" + 'db', + 'table', + "\n", + "example.com", + "create_table", + "test" ) ); $result = ob_get_clean(); @@ -382,7 +387,11 @@ class ExportMediawikiTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index 5ce85ea51e..eae5eb4103 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -168,7 +168,6 @@ class ExportOdsTest extends PmaTestCase 'structure_or_data', $property->getName() ); - } /** @@ -361,7 +360,11 @@ class ExportOdsTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); @@ -444,7 +447,11 @@ class ExportOdsTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); @@ -497,7 +504,11 @@ class ExportOdsTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index 5257fd9ff2..c7e1a3c9e5 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -479,7 +479,11 @@ class ExportOdtTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'ta<ble', "\n", "example.com", "SELECT" + 'db', + 'ta<ble', + "\n", + "example.com", + "SELECT" ) ); @@ -555,7 +559,11 @@ class ExportOdtTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); @@ -610,7 +618,11 @@ class ExportOdtTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "example.com", "SELECT" + 'db', + 'table', + "\n", + "example.com", + "SELECT" ) ); @@ -961,8 +973,16 @@ class ExportOdtTest extends PmaTestCase $this->object->expects($this->at(2)) ->method('getTableDef') ->with( - 'db', 't&bl', "\n", "example.com", - false, false, false, false, true, true + 'db', + 't&bl', + "\n", + "example.com", + false, + false, + false, + false, + true, + true ) ->will($this->returnValue('dumpText3')); @@ -976,7 +996,12 @@ class ExportOdtTest extends PmaTestCase // case 1 $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_table", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_table", + "test" ) ); @@ -991,7 +1016,12 @@ class ExportOdtTest extends PmaTestCase $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "triggers", "test" + 'db', + 't&bl', + "\n", + "example.com", + "triggers", + "test" ) ); @@ -1006,7 +1036,12 @@ class ExportOdtTest extends PmaTestCase $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_view", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_view", + "test" ) ); @@ -1020,7 +1055,12 @@ class ExportOdtTest extends PmaTestCase $GLOBALS['odt_buffer'] = ''; $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "stand_in", "test" + 'db', + 't&bl', + "\n", + "example.com", + "stand_in", + "test" ) ); @@ -1039,7 +1079,8 @@ class ExportOdtTest extends PmaTestCase public function testFormatOneColumnDefinition() { $method = new ReflectionMethod( - 'PhpMyAdmin\Plugins\Export\ExportOdt', 'formatOneColumnDefinition' + 'PhpMyAdmin\Plugins\Export\ExportOdt', + 'formatOneColumnDefinition' ); $method->setAccessible(true); diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 7c714e2f15..bae8b1f4e7 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -174,7 +174,6 @@ class ExportPdfTest extends PmaTestCase ], $property->getValues() ); - } /** @@ -296,7 +295,11 @@ class ExportPdfTest extends PmaTestCase $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", "phpmyadmin.net/err", 'SELECT' + 'db', + 'table', + "\n", + "phpmyadmin.net/err", + 'SELECT' ) ); } diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index 9e6354bae0..cf2c4222db 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -250,14 +250,18 @@ class ExportPhparrayTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', 'table', "\n", 'phpmyadmin.net/err', 'SELECT' + 'db', + 'table', + "\n", + 'phpmyadmin.net/err', + 'SELECT' ) ); $result = ob_get_clean(); $this->assertEquals( "\n" . '/* `db`.`table` */' . "\n" . - '$table = array(' . "\n" . + '$table = array(' . "\n" . ' array(\'c1\' => 1,\'\' => \'a\')' . "\n" . ');' . "\n", $result @@ -288,7 +292,11 @@ class ExportPhparrayTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', '0`932table', "\n", 'phpmyadmin.net/err', 'SELECT' + 'db', + '0`932table', + "\n", + 'phpmyadmin.net/err', + 'SELECT' ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 087d70aceb..021da76da3 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -862,7 +862,10 @@ class ExportSqlTest extends PmaTestCase $method = new ReflectionMethod('PhpMyAdmin\Plugins\Export\ExportSql', '_getTableDefForView'); $method->setAccessible(true); $result = $method->invoke( - $this->object, 'db', 'view', "\n" + $this->object, + 'db', + 'view', + "\n" ); $this->assertEquals( @@ -900,7 +903,11 @@ class ExportSqlTest extends PmaTestCase $GLOBALS['dbi'] = $dbi; $result = $method->invoke( - $this->object, 'db', 'view', "\n", false + $this->object, + 'db', + 'view', + "\n", + false ); $this->assertEquals( @@ -1017,7 +1024,13 @@ class ExportSqlTest extends PmaTestCase $GLOBALS['cfg']['Server']['DisableIS'] = false; $result = $this->object->getTableDef( - 'db', 'table', "\n", "example.com/err", true, true, false + 'db', + 'table', + "\n", + "example.com/err", + true, + true, + false ); $this->assertContains( @@ -1167,7 +1180,13 @@ class ExportSqlTest extends PmaTestCase $GLOBALS['cfg']['Server']['DisableIS'] = false; $result = $this->object->getTableDef( - 'db', 'table', "\n", "example.com/err", true, true, false + 'db', + 'table', + "\n", + "example.com/err", + true, + true, + false ); $this->assertContains( @@ -1225,7 +1244,12 @@ class ExportSqlTest extends PmaTestCase $method = new ReflectionMethod('PhpMyAdmin\Plugins\Export\ExportSql', '_getTableComments'); $method->setAccessible(true); $result = $method->invoke( - $this->object, 'db', '', "\n", true, true + $this->object, + 'db', + '', + "\n", + true, + true ); $this->assertContains( @@ -1281,7 +1305,11 @@ class ExportSqlTest extends PmaTestCase $this->object->expects($this->at(1)) ->method('getTableDef') ->with( - 'db', 't&bl', "\n", "example.com", false + 'db', + 't&bl', + "\n", + "example.com", + false ) ->will($this->returnValue('dumpText3')); @@ -1300,7 +1328,12 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_table", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_table", + "test" ) ); $result = ob_get_clean(); @@ -1325,7 +1358,12 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "triggers", "test" + 'db', + 't&bl', + "\n", + "example.com", + "triggers", + "test" ) ); $result = ob_get_clean(); @@ -1349,7 +1387,12 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_view", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_view", + "test" ) ); $result = ob_get_clean(); @@ -1385,7 +1428,12 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_view", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_view", + "test" ) ); $result = ob_get_clean(); @@ -1405,7 +1453,12 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "stand_in", "test" + 'db', + 't&bl', + "\n", + "example.com", + "stand_in", + "test" ) ); $result = ob_get_clean(); @@ -1530,7 +1583,10 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->object->exportData( - 'db', 'table', "\n", "example.com/err", + 'db', + 'table', + "\n", + "example.com/err", "SELECT a FROM b WHERE 1" ); $result = ob_get_clean(); @@ -1561,7 +1617,6 @@ class ExportSqlTest extends PmaTestCase "SET IDENTITY_INSERT "table" OFF;", $result ); - } /** @@ -1660,7 +1715,10 @@ class ExportSqlTest extends PmaTestCase ob_start(); $this->object->exportData( - 'db', 'table', "\n", "example.com/err", + 'db', + 'table', + "\n", + "example.com/err", "SELECT a FROM b WHERE 1" ); $result = ob_get_clean(); @@ -1670,7 +1728,6 @@ class ExportSqlTest extends PmaTestCase '"name" = NULL WHERE CONCAT(`tbl`.`pma`) IS NULL;', $result ); - } /** @@ -1804,11 +1861,13 @@ class ExportSqlTest extends PmaTestCase " \" double NOT NULL DEFAULT '213'\n"; $method = new ReflectionMethod( - 'PhpMyAdmin\Plugins\Export\ExportSql', '_makeCreateTableMSSQLCompatible' + 'PhpMyAdmin\Plugins\Export\ExportSql', + '_makeCreateTableMSSQLCompatible' ); $method->setAccessible(true); $result = $method->invoke( - $this->object, $query + $this->object, + $query ); $this->assertEquals( @@ -1906,19 +1965,23 @@ class ExportSqlTest extends PmaTestCase ]; $this->assertEquals( - 'f', $this->object->getAlias($aliases, 'bar') + 'f', + $this->object->getAlias($aliases, 'bar') ); $this->assertEquals( - 'aliastest', $this->object->getAlias($aliases, 'a') + 'aliastest', + $this->object->getAlias($aliases, 'a') ); $this->assertEquals( - 'pphymdain', $this->object->getAlias($aliases, 'pqr') + 'pphymdain', + $this->object->getAlias($aliases, 'pqr') ); $this->assertEquals( - '', $this->object->getAlias($aliases, 'abc') + '', + $this->object->getAlias($aliases, 'abc') ); } @@ -1963,7 +2026,10 @@ class ExportSqlTest extends PmaTestCase . ") ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=" . "latin1_general_ci COMMENT='List' AUTO_INCREMENT=5"; $result = $this->object->replaceWithAliases( - $sql_query, $aliases, $db, $table + $sql_query, + $aliases, + $db, + $table ); $this->assertEquals( @@ -1999,7 +2065,10 @@ class ExportSqlTest extends PmaTestCase . "SET NEW.xy=1; " . "END IF; END"; $result = $this->object->replaceWithAliases( - $sql_query, $aliases, $db, $table + $sql_query, + $aliases, + $db, + $table ); $this->assertEquals( diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index 4cb1445bab..6d0a8b5462 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -277,7 +277,11 @@ class ExportTexytextTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', 'ta<ble', "\n", "example.com", "SELECT" + 'db', + 'ta<ble', + "\n", + "example.com", + "SELECT" ) ); $result = ob_get_clean(); @@ -291,7 +295,6 @@ class ExportTexytextTest extends PmaTestCase "|&gt;|0|test", $result ); - } /** @@ -496,7 +499,6 @@ class ExportTexytextTest extends PmaTestCase '|Name|Time|Event|Definition', $result ); - } /** @@ -533,8 +535,16 @@ class ExportTexytextTest extends PmaTestCase $this->object->expects($this->at(2)) ->method('getTableDef') ->with( - 'db', 't&bl', "\n", "example.com", - false, false, false, false, true, true + 'db', + 't&bl', + "\n", + "example.com", + false, + false, + false, + false, + true, + true ) ->will($this->returnValue('dumpText3')); @@ -549,7 +559,12 @@ class ExportTexytextTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_table", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_table", + "test" ) ); $result = ob_get_clean(); @@ -563,7 +578,12 @@ class ExportTexytextTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "triggers", "test" + 'db', + 't&bl', + "\n", + "example.com", + "triggers", + "test" ) ); $result = ob_get_clean(); @@ -577,7 +597,12 @@ class ExportTexytextTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "create_view", "test" + 'db', + 't&bl', + "\n", + "example.com", + "create_view", + "test" ) ); $result = ob_get_clean(); @@ -591,7 +616,12 @@ class ExportTexytextTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportStructure( - 'db', 't&bl', "\n", "example.com", "stand_in", "test" + 'db', + 't&bl', + "\n", + "example.com", + "stand_in", + "test" ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 6b20f756a6..851b9db788 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -522,7 +522,11 @@ class ExportXmlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', 'ta<ble', "\n", "example.com", "SELECT" + 'db', + 'ta<ble', + "\n", + "example.com", + "SELECT" ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index 6bd9ce711e..441cf8050c 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -253,7 +253,11 @@ class ExportYamlTest extends PmaTestCase ob_start(); $this->assertTrue( $this->object->exportData( - 'db', 'ta<ble', "\n", "example.com", "SELECT" + 'db', + 'ta<ble', + "\n", + "example.com", + "SELECT" ) ); $result = ob_get_clean(); diff --git a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php index 64a5e2eb10..9cdc6495d1 100644 --- a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php +++ b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php @@ -341,5 +341,4 @@ class TablePropertyTest extends PmaTestCase ) ); } - } diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index 4373ba338f..58e92348c4 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -98,7 +98,6 @@ class ImportMediawikiTest extends PmaTestCase __('Options'), $properties->getOptionsText() ); - } /** @@ -160,6 +159,5 @@ class ImportMediawikiTest extends PmaTestCase true, $GLOBALS['finished'] ); - } } diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index ba3c1e5cdc..7ac1012af1 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -120,7 +120,6 @@ class ImportShpTest extends PmaTestCase __('Options'), $properties->getOptionsText() ); - } /** diff --git a/test/classes/Plugins/Import/ImportSqlTest.php b/test/classes/Plugins/Import/ImportSqlTest.php index 5a2672a1e7..7fa5767191 100644 --- a/test/classes/Plugins/Import/ImportSqlTest.php +++ b/test/classes/Plugins/Import/ImportSqlTest.php @@ -109,6 +109,5 @@ class ImportSqlTest extends PmaTestCase true, $GLOBALS['finished'] ); - } } diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index 4e50baf288..320d829cef 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -99,7 +99,6 @@ class ImportXmlTest extends PmaTestCase __('Options'), $properties->getOptionsText() ); - } /** @@ -161,6 +160,5 @@ class ImportXmlTest extends PmaTestCase true, $GLOBALS['finished'] ); - } } diff --git a/test/classes/Plugins/Transformations/TransformationPluginsTest.php b/test/classes/Plugins/Transformations/TransformationPluginsTest.php index 951f3e2b0c..10df1bf90d 100644 --- a/test/classes/Plugins/Transformations/TransformationPluginsTest.php +++ b/test/classes/Plugins/Transformations/TransformationPluginsTest.php @@ -991,7 +991,11 @@ class TransformationPluginsTest extends PmaTestCase * @group medium */ public function testTransformation( - $object, $applyArgs, $transformed, $success = true, $error = '' + $object, + $applyArgs, + $transformed, + $success = true, + $error = '' ) { $reflectionMethod = new ReflectionMethod($object, 'applyTransformation'); $this->assertEquals( diff --git a/test/classes/PmaTestCase.php b/test/classes/PmaTestCase.php index de92c87fea..c6147a1ec0 100644 --- a/test/classes/PmaTestCase.php +++ b/test/classes/PmaTestCase.php @@ -69,7 +69,7 @@ class PmaTestCase extends TestCase if (is_array($param[0])) { if (is_array($param[0][0]) && count($param) == 1) { $param = $param[0]; - if(is_int(end($param))){ + if (is_int(end($param))) { $http_response_code_param = end($param); $param = array_slice($param, 0, -1); @@ -82,7 +82,6 @@ class PmaTestCase extends TestCase ->method('header'); call_user_func_array([$header_method, 'withConsecutive'], $param); - } else { $mockResponse->expects($this->once()) ->method('header') diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php index 1bf33b3c62..a7ef918a70 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php @@ -53,5 +53,4 @@ class OptionsPropertyMainGroupTest extends TestCase $this->object->getItemType() ); } - } diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php index 963aefa35a..aa72390b7b 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php @@ -66,5 +66,4 @@ class OptionsPropertyRootGroupTest extends TestCase $this->object ); } - } diff --git a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php index 5039ce3005..7ea14591b6 100644 --- a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php @@ -70,5 +70,4 @@ class ExportPluginPropertiesTest extends ImportPluginPropertiesTest $this->object->getForceFile() ); } - } diff --git a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php index b21a4fd1fc..40f288108a 100644 --- a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php @@ -87,5 +87,4 @@ class ImportPluginPropertiesTest extends TestCase $this->object->getMimeType() ); } - } diff --git a/test/classes/RelationCleanupTest.php b/test/classes/RelationCleanupTest.php index d9d80ea896..ea924b8695 100644 --- a/test/classes/RelationCleanupTest.php +++ b/test/classes/RelationCleanupTest.php @@ -154,7 +154,6 @@ class RelationCleanupTest extends TestCase null, $is_defined_relation ); - } /** diff --git a/test/classes/RelationTest.php b/test/classes/RelationTest.php index df17071e0c..9402230d3c 100644 --- a/test/classes/RelationTest.php +++ b/test/classes/RelationTest.php @@ -200,7 +200,6 @@ class RelationTest extends TestCase false, $this->relation->getDisplayField($db, $table) ); - } /** diff --git a/test/classes/Rte/TriggersTest.php b/test/classes/Rte/TriggersTest.php index 12048edf98..53a926d936 100644 --- a/test/classes/Rte/TriggersTest.php +++ b/test/classes/Rte/TriggersTest.php @@ -341,7 +341,14 @@ class TriggersTest extends TestCase * @dataProvider providerGetQueryFromRequest */ public function testGetQueryFromRequest( - $definer, $name, $timing, $event, $table, $definition, $query, $num_err + $definer, + $name, + $timing, + $event, + $table, + $definition, + $query, + $num_err ) { global $_REQUEST, $errors; diff --git a/test/classes/SanitizeTest.php b/test/classes/SanitizeTest.php index 8373bffa31..622cd3cd80 100644 --- a/test/classes/SanitizeTest.php +++ b/test/classes/SanitizeTest.php @@ -280,5 +280,4 @@ class SanitizeTest extends TestCase $this->assertArrayNotHasKey('second', $_REQUEST); $this->assertArrayHasKey('allow', $_REQUEST); } - } diff --git a/test/classes/ScriptsTest.php b/test/classes/ScriptsTest.php index 751245d277..71dfc1a2c7 100644 --- a/test/classes/ScriptsTest.php +++ b/test/classes/ScriptsTest.php @@ -115,7 +115,6 @@ class ScriptsTest extends PmaTestCase . '// ]]></script>@', $this->object->getDisplay() ); - } /** @@ -189,7 +188,6 @@ $(function() {}); '_files', $this->object ); - } /** diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 52808b38f7..116d044dfb 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -204,7 +204,6 @@ class PrivilegesTest extends TestCase true, $dbname_is_wildcard ); - } /** @@ -340,8 +339,13 @@ class PrivilegesTest extends TestCase $name_for_current = 'name_for_current'; $html = $this->serverPrivileges->getHtmlForColumnPrivileges( - $columns, $row, $name_for_select, - $priv_for_header, $name, $name_for_dfn, $name_for_current + $columns, + $row, + $name_for_select, + $priv_for_header, + $name, + $name_for_dfn, + $name_for_current ); //$name $this->assertContains( @@ -687,7 +691,10 @@ class PrivilegesTest extends TestCase //$db == '*' $ret = $this->serverPrivileges->getSqlQueryForDisplayPrivTable( - $db, $table, $username, $hostname + $db, + $table, + $username, + $hostname ); $sql = "SELECT * FROM `mysql`.`user`" . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" @@ -701,7 +708,10 @@ class PrivilegesTest extends TestCase $db = "pma_db"; $table = "*"; $ret = $this->serverPrivileges->getSqlQueryForDisplayPrivTable( - $db, $table, $username, $hostname + $db, + $table, + $username, + $hostname ); $sql = "SELECT * FROM `mysql`.`db`" . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" @@ -717,7 +727,10 @@ class PrivilegesTest extends TestCase $db = "pma_db"; $table = "pma_table"; $ret = $this->serverPrivileges->getSqlQueryForDisplayPrivTable( - $db, $table, $username, $hostname + $db, + $table, + $username, + $hostname ); $sql = "SELECT `Table_priv`" . " FROM `mysql`.`tables_priv`" @@ -734,7 +747,10 @@ class PrivilegesTest extends TestCase $db = "db' AND"; $table = "pma_table"; $ret = $this->serverPrivileges->getSqlQueryForDisplayPrivTable( - $db, $table, $username, $hostname + $db, + $table, + $username, + $hostname ); $this->assertEquals( "SELECT `Table_priv` FROM `mysql`.`tables_priv` " @@ -927,7 +943,9 @@ class PrivilegesTest extends TestCase $_REQUEST['authentication_plugin'] = 'mysql_native_password'; $message = $this->serverPrivileges->updatePassword( - $err_url, $username, $hostname + $err_url, + $username, + $hostname ); $this->assertEquals( @@ -956,7 +974,11 @@ class PrivilegesTest extends TestCase $_POST['max_questions'] = 1000; list ($message, $sql_query) = $this->serverPrivileges->getMessageAndSqlQueryForPrivilegesRevoke( - $dbname, $tablename, $username, $hostname, '' + $dbname, + $tablename, + $username, + $hostname, + '' ); $this->assertEquals( @@ -990,7 +1012,11 @@ class PrivilegesTest extends TestCase $_POST['Grant_priv'] = 'Y'; $_POST['max_questions'] = 1000; list($sql_query, $message) = $this->serverPrivileges->updatePrivileges( - $username, $hostname, $tablename, $dbname, '' + $username, + $hostname, + $tablename, + $dbname, + '' ); $this->assertEquals( @@ -1192,7 +1218,12 @@ class PrivilegesTest extends TestCase //Test for addUserAndCreateDatabase list($sql_query, $message) = $this->serverPrivileges->addUserAndCreateDatabase( - false, $real_sql_query, $sql_query, $username, $hostname, $dbname + false, + $real_sql_query, + $sql_query, + $username, + $hostname, + $dbname ); //validate 5: $sql_query @@ -1234,12 +1265,18 @@ class PrivilegesTest extends TestCase ]; $html = $this->serverPrivileges->getHtmlForTableSpecificPrivileges( - $username, $hostname, $db, $table, $columns, $row + $username, + $hostname, + $db, + $table, + $columns, + $row ); //validate 1: getHtmlForAttachedPrivilegesToTableSpecificColumn $item = $this->serverPrivileges->getHtmlForAttachedPrivilegesToTableSpecificColumn( - $columns, $row + $columns, + $row ); $this->assertContains( $item, @@ -1360,7 +1397,6 @@ class PrivilegesTest extends TestCase $expect, $sql_query ); - } /** @@ -1718,7 +1754,12 @@ class PrivilegesTest extends TestCase $tablename = "pma_tablename"; $html = $this->serverPrivileges->getUserLink( - 'edit', $username, $hostname, $dbname, $tablename, '' + 'edit', + $username, + $hostname, + $dbname, + $tablename, + '' ); $url_html = Url::getCommon( @@ -1740,7 +1781,12 @@ class PrivilegesTest extends TestCase ); $html = $this->serverPrivileges->getUserLink( - 'revoke', $username, $hostname, $dbname, $tablename, '' + 'revoke', + $username, + $hostname, + $dbname, + $tablename, + '' ); $url_html = Url::getCommon( @@ -1801,7 +1847,10 @@ class PrivilegesTest extends TestCase $_POST['update_privs'] = "update_privs"; $extra_data = $this->serverPrivileges->getExtraDataForAjaxBehavior( - $password, $sql_query, $hostname, $username + $password, + $sql_query, + $hostname, + $username ); //user_exists @@ -1976,7 +2025,8 @@ class PrivilegesTest extends TestCase ); $this->assertContains( Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + $GLOBALS['cfg']['DefaultTabDatabase'], + 'database' ), $html ); @@ -2002,7 +2052,8 @@ class PrivilegesTest extends TestCase ); $this->assertContains( Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabTable'], 'table' + $GLOBALS['cfg']['DefaultTabTable'], + 'table' ), $html ); @@ -2044,7 +2095,10 @@ class PrivilegesTest extends TestCase $GLOBALS['cfgRelation']['menuswork'] = true; $html = $this->serverPrivileges->getUsersOverview( - $result, $db_rights, $pmaThemeImage, $text_dir + $result, + $db_rights, + $pmaThemeImage, + $text_dir ); //Url::getHiddenInputs @@ -2125,7 +2179,10 @@ class PrivilegesTest extends TestCase $GLOBALS['cfgRelation']['menuswork'] = true; $html = $this->serverPrivileges->getUsersOverview( - $result, $db_rights, $pmaThemeImage, $text_dir + $result, + $db_rights, + $pmaThemeImage, + $text_dir ); //Url::getCommon @@ -2230,8 +2287,13 @@ class PrivilegesTest extends TestCase $_REQUEST['tablename'] = "tablename"; $html = $this->serverPrivileges->getHtmlHeaderForUserProperties( - $dbname_is_wildcard, $url_dbname, $dbname, - $username, $hostname, $tablename, 'table' + $dbname_is_wildcard, + $url_dbname, + $dbname, + $username, + $hostname, + $tablename, + 'table' ); //title @@ -2320,7 +2382,12 @@ class PrivilegesTest extends TestCase function testGetHtmlForUserProperties() { $actual = $this->serverPrivileges->getHtmlForUserProperties( - false, 'db', 'user', 'host', 'db', 'table' + false, + 'db', + 'user', + 'host', + 'db', + 'table' ); $this->assertContains('addUsersForm', $actual); $this->assertContains('SELECT', $actual); @@ -2344,7 +2411,8 @@ class PrivilegesTest extends TestCase { $actual = $this->serverPrivileges->getHtmlForUserOverview('theme', ''); $this->assertContains( - 'Note: MySQL privilege names are expressed in English.', $actual + 'Note: MySQL privilege names are expressed in English.', + $actual ); $this->assertContains( 'Note: phpMyAdmin gets the users’ privileges directly ' @@ -2496,8 +2564,12 @@ class PrivilegesTest extends TestCase ->method('fetchAssoc') ->will( $this->onConsecutiveCalls( - $plugins[0], $plugins[1], null, /* For Assertion 1 */ - $plugins[0], $plugins[1], null /* For Assertion 2 */ + $plugins[0], + $plugins[1], + null, /* For Assertion 1 */ + $plugins[0], + $plugins[1], + null /* For Assertion 2 */ ) ); $GLOBALS['dbi'] = $dbi; @@ -2549,7 +2621,7 @@ class PrivilegesTest extends TestCase . 'id="select_authentication_plugin">' . "\n" . '<option ' . 'value="mysql_native_password" selected="selected">' - . 'Native MySQL authentication</option>'. "\n" .'</select>' + . 'Native MySQL authentication</option>' . "\n" . '</select>' . "\n", $actualHtml ); @@ -2605,7 +2677,8 @@ class PrivilegesTest extends TestCase $this->assertArrayHasKey(1, $actual); $this->assertEquals('', $actual[0]); $this->assertEquals( - 'No users selected for deleting!', $actual[1]->getMessage() + 'No users selected for deleting!', + $actual[1]->getMessage() ); // Test case 2 : all successful queries diff --git a/test/classes/Server/SelectTest.php b/test/classes/Server/SelectTest.php index b3723d9406..35007f231d 100644 --- a/test/classes/Server/SelectTest.php +++ b/test/classes/Server/SelectTest.php @@ -111,7 +111,8 @@ class SelectTest extends TestCase //$GLOBALS['cfg']['DefaultTabServer'] $this->assertContains( Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabServer'], 'server' + $GLOBALS['cfg']['DefaultTabServer'], + 'server' ), $html ); diff --git a/test/classes/Server/Status/QueriesTest.php b/test/classes/Server/Status/QueriesTest.php index 9068023a3c..beb2a93bfd 100644 --- a/test/classes/Server/Status/QueriesTest.php +++ b/test/classes/Server/Status/QueriesTest.php @@ -221,6 +221,5 @@ class QueriesTest extends TestCase '<div id="serverstatusquerieschart" class="width100" data-chart="', $html ); - } } diff --git a/test/classes/Server/UserGroupsTest.php b/test/classes/Server/UserGroupsTest.php index f161d8233e..7394d736f6 100644 --- a/test/classes/Server/UserGroupsTest.php +++ b/test/classes/Server/UserGroupsTest.php @@ -38,7 +38,6 @@ class UserGroupsTest extends TestCase 'users' => 'users', 'usergroups' => 'usergroups' ]; - } /** diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index 1bded929bd..41aa3c7853 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -46,7 +46,7 @@ class FormProcessingTest extends PmaTestCase ['Location: index.php?lang=en'], 303 ] - ); + ); // case 1 $formDisplay = $this->getMockBuilder('PhpMyAdmin\Config\FormDisplay') diff --git a/test/classes/StorageEngineTest.php b/test/classes/StorageEngineTest.php index 5afa44f1f1..cafd6ec94f 100644 --- a/test/classes/StorageEngineTest.php +++ b/test/classes/StorageEngineTest.php @@ -34,7 +34,8 @@ class StorageEngineTest extends PmaTestCase { $GLOBALS['server'] = 1; $this->object = $this->getMockForAbstractClass( - 'PhpMyAdmin\StorageEngine', ['dummy'] + 'PhpMyAdmin\StorageEngine', + ['dummy'] ); } @@ -110,7 +111,8 @@ class StorageEngineTest extends PmaTestCase public function testGetEngine($expectedClass, $engineName) { $this->assertInstanceOf( - $expectedClass, StorageEngine::getEngine($engineName) + $expectedClass, + StorageEngine::getEngine($engineName) ); } diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index 6c5d52244f..6b1cc89b8e 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -110,7 +110,10 @@ class SystemDatabaseTest extends PmaTestCase $view_name = "view_name"; $ret = $this->sysDb->getNewTransformationDataSql( - $pma_transformation_data, $column_map, $view_name, $db + $pma_transformation_data, + $column_map, + $view_name, + $db ); $sql = "INSERT INTO `information_schema`.`column_info` " diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 90b1d567df..141ea6eeef 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -198,7 +198,7 @@ class TableTest extends PmaTestCase 'Type'=> 'INT(10)', 'Null'=> 'NO', 'Key'=> '', - 'Default'=> NULL, + 'Default'=> null, 'Extra'=>'' ], [ @@ -206,7 +206,7 @@ class TableTest extends PmaTestCase 'Type'=> 'INT(10)', 'Null'=> 'YES', 'Key'=> '', - 'Default'=> NULL, + 'Default'=> null, 'Extra'=>'STORED GENERATED' ] ] @@ -474,9 +474,19 @@ class TableTest extends PmaTestCase $move_to = '-first'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BIT(12) PMA_attribute NULL DEFAULT b'10' " @@ -487,9 +497,19 @@ class TableTest extends PmaTestCase //type is DOUBLE $type = "DOUBLE"; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` DOUBLE(12) PMA_attribute NULL DEFAULT '12' " @@ -500,9 +520,19 @@ class TableTest extends PmaTestCase //type is BOOLEAN $type = "BOOLEAN"; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT TRUE " @@ -513,9 +543,19 @@ class TableTest extends PmaTestCase //$default_type is NULL $default_type = 'NULL'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT NULL " @@ -526,9 +566,19 @@ class TableTest extends PmaTestCase //$default_type is CURRENT_TIMESTAMP $default_type = 'CURRENT_TIMESTAMP'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP " @@ -539,9 +589,19 @@ class TableTest extends PmaTestCase //$default_type is current_timestamp() $default_type = 'current_timestamp()'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT current_timestamp() " @@ -555,9 +615,19 @@ class TableTest extends PmaTestCase $extra = ''; $default_type = 'CURRENT_TIMESTAMP'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` TIMESTAMP(3) PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP(3) " @@ -571,9 +641,19 @@ class TableTest extends PmaTestCase $extra = 'INCREMENT'; $move_to = '-first'; $query = Table::generateFieldSpec( - $name, $type, $length, $attribute, $collation, - $null, $default_type, $default_value, $extra, $comment, - $virtuality, $expression, $move_to + $name, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $this->assertEquals( "`PMA_name` BOOLEAN PMA_attribute NULL INCREMENT " @@ -600,7 +680,11 @@ class TableTest extends PmaTestCase $GLOBALS['cfgRelation'][$pma_table] = "pma_table"; $ret = Table::duplicateInfo( - $work, $pma_table, $get_fields, $where_fields, $new_fields + $work, + $pma_table, + $get_fields, + $where_fields, + $new_fields ); $this->assertEquals( true, @@ -747,9 +831,20 @@ class TableTest extends PmaTestCase $move_to = 'new_name'; $result = Table::generateAlter( - $oldcol, $newcol, $type, $length, - $attribute, $collation, $null, $default_type, $default_value, - $extra, $comment, $virtuality, $expression, $move_to + $oldcol, + $newcol, + $type, + $length, + $attribute, + $collation, + $null, + $default_type, + $default_value, + $extra, + $comment, + $virtuality, + $expression, + $move_to ); $expect = "`name` `new_name` VARCHAR(2) new_name CHARACTER SET " @@ -926,7 +1021,8 @@ class TableTest extends PmaTestCase $tableObj = new Table('PMA_table', 'db'); $sql = $method->invokeArgs( - $tableObj, [ + $tableObj, + [ $table, $field, $foreignDb, @@ -944,7 +1040,8 @@ class TableTest extends PmaTestCase // Exclude db name when relations are made between table in the same db $sql = $method->invokeArgs( - $tableObj, [ + $tableObj, + [ $table, $field, 'db', @@ -1047,10 +1144,8 @@ class TableTest extends PmaTestCase ->method('fetchResult') ->willReturnOnConsecutiveCalls( [['`one_pk`']], - [], // No Uniques found ['`one_ind`', '`sec_ind`'], - [], // No Uniques found [] // No Indexed found ); @@ -1179,8 +1274,13 @@ class TableTest extends PmaTestCase $_REQUEST['drop_if_exists'] = true; $return = Table::moveCopy( - $source_db, $source_table, $target_db, - $target_table, $what, $move, $mode + $source_db, + $source_table, + $target_db, + $target_table, + $what, + $move, + $mode ); //successfully @@ -1203,8 +1303,13 @@ class TableTest extends PmaTestCase ); $return = Table::moveCopy( - $source_db, $source_table, $target_db, - $target_table, $what, false, $mode + $source_db, + $source_table, + $target_db, + $target_table, + $what, + false, + $mode ); //successfully @@ -1232,7 +1337,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetStorageEngine(){ + public function testGetStorageEngine() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1255,7 +1361,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetComment(){ + public function testGetComment() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1278,7 +1385,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetCollation(){ + public function testGetCollation() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1301,7 +1409,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetRowFormat(){ + public function testGetRowFormat() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1324,7 +1433,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetAutoIncrement(){ + public function testGetAutoIncrement() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); @@ -1347,7 +1457,8 @@ class TableTest extends PmaTestCase * * @return void */ - public function testGetCreateOptions(){ + public function testGetCreateOptions() + { $target_table = 'table1'; $target_db = 'pma_test'; $tbl_object = new Table($target_db, $target_table); diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index dd12fe7128..6480bad2e6 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -413,8 +413,12 @@ class TrackerTest extends PmaTestCase * @test * */ - public function testChangeTracking($dbname = 'pma_db', $tablename = 'pma_tbl', - $version = '0.1', $new_state = '1', $type = null + public function testChangeTracking( + $dbname = 'pma_db', + $tablename = 'pma_tbl', + $version = '0.1', + $new_state = '1', + $type = null ) { $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface') ->disableOriginalConstructor() @@ -705,8 +709,13 @@ class TrackerTest extends PmaTestCase * @test * @dataProvider parseQueryData */ - public function testParseQuery($query, $type, $identifier, $tablename, - $db = null, $tablename_after_rename = null + public function testParseQuery( + $query, + $type, + $identifier, + $tablename, + $db = null, + $tablename_after_rename = null ) { $result = Tracker::parseQuery($query); diff --git a/test/classes/TrackingTest.php b/test/classes/TrackingTest.php index 00716a8d0b..c6e4ed7084 100644 --- a/test/classes/TrackingTest.php +++ b/test/classes/TrackingTest.php @@ -101,7 +101,10 @@ class TrackingTest extends TestCase $filter_users = ["username1"]; $ret = $this->tracking->filter( - $data, $filter_ts_from, $filter_ts_to, $filter_users + $data, + $filter_ts_from, + $filter_ts_to, + $filter_users ); $this->assertEquals( @@ -165,7 +168,10 @@ class TrackingTest extends TestCase $url_query = "url_query"; $last_version = 10; $html = $this->tracking->getHtmlForDataDefinitionAndManipulationStatements( - $url_query, $last_version, $GLOBALS['db'], [$GLOBALS['table']] + $url_query, + $last_version, + $GLOBALS['db'], + [$GLOBALS['table']] ); $this->assertContains( @@ -217,7 +223,9 @@ class TrackingTest extends TestCase $url_query = "url_query"; $last_version = "10"; $html = $this->tracking->getHtmlForActivateDeactivateTracking( - 'activate', $url_query, $last_version + 'activate', + $url_query, + $last_version ); $this->assertContains( @@ -245,7 +253,9 @@ class TrackingTest extends TestCase ); $html = $this->tracking->getHtmlForActivateDeactivateTracking( - 'deactivate', $url_query, $last_version + 'deactivate', + $url_query, + $last_version ); $this->assertContains( @@ -462,8 +472,12 @@ class TrackingTest extends TestCase $GLOBALS['dbi'] = $dbi; $ret = $this->tracking->getHtmlForTableVersionDetails( - $sql_result, $last_version, $url_params, $url_query, - $pmaThemeImage, $text_dir + $sql_result, + $last_version, + $url_params, + $url_query, + $pmaThemeImage, + $text_dir ); $this->assertContains( @@ -560,7 +574,8 @@ class TrackingTest extends TestCase $GLOBALS['dbi'] = $dbi; $ret = $this->tracking->getHtmlForSelectableTables( - $selectable_tables_sql_result, $url_query + $selectable_tables_sql_result, + $url_query ); $this->assertContains( @@ -604,10 +619,15 @@ class TrackingTest extends TestCase $filter_users = []; $html = $this->tracking->getHtmlForTrackingReport( - $url_query, $data, $url_params, - $selection_schema, $selection_data, - $selection_both, $filter_ts_to, - $filter_ts_from, $filter_users + $url_query, + $data, + $url_params, + $selection_schema, + $selection_data, + $selection_both, + $filter_ts_to, + $filter_ts_from, + $filter_users ); $this->assertContains( @@ -706,9 +726,13 @@ class TrackingTest extends TestCase $filter_users = ["*"]; $html = $this->tracking->getHtmlForDataManipulationStatements( - $data, $filter_users, - $filter_ts_from, $filter_ts_to, $url_params, - $ddlog_count, $drop_image_or_text + $data, + $filter_users, + $filter_ts_from, + $filter_ts_to, + $url_params, + $ddlog_count, + $drop_image_or_text ); $this->assertContains( @@ -765,8 +789,12 @@ class TrackingTest extends TestCase $drop_image_or_text = "text"; list($html, $count) = $this->tracking->getHtmlForDataDefinitionStatements( - $data, $filter_users, - $filter_ts_from, $filter_ts_to, $url_params, $drop_image_or_text + $data, + $filter_users, + $filter_ts_from, + $filter_ts_to, + $url_params, + $drop_image_or_text ); $this->assertContains( @@ -799,7 +827,6 @@ class TrackingTest extends TestCase 2, $count ); - } /** @@ -953,7 +980,10 @@ class TrackingTest extends TestCase $filter_ts_from = 0; $entries = $this->tracking->getEntries( - $data, $filter_ts_from, $filter_ts_to, $filter_users + $data, + $filter_ts_from, + $filter_ts_to, + $filter_users ); $this->assertEquals( 'username3', diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index 14480e2467..12c838cf25 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -95,7 +95,7 @@ class TransformationsTest extends TestCase public function testGetTypes() { $this->assertEquals( - [ + [ 'mimetype' => [ 'Application/Octetstream' => 'Application/Octetstream', 'Image/JPEG' => 'Image/JPEG', @@ -171,7 +171,7 @@ class TransformationsTest extends TestCase 'Text_Plain_PreApPend.php', 'Text_Plain_Substring.php', ], - ], + ], $this->transformations->getAvailableMimeTypes() ); } diff --git a/test/classes/TypesTest.php b/test/classes/TypesTest.php index 13978900ed..c2cc6e6583 100644 --- a/test/classes/TypesTest.php +++ b/test/classes/TypesTest.php @@ -231,7 +231,10 @@ class TypesTest extends PmaTestCase * @dataProvider providerForTestGetTypeOperatorsHtml */ public function testGetTypeOperatorsHtml( - $type, $null, $selectedOperator, $output + $type, + $null, + $selectedOperator, + $output ) { $this->assertEquals( $output, diff --git a/test/classes/UrlTest.php b/test/classes/UrlTest.php index e7100de86d..ddd3e57cea 100644 --- a/test/classes/UrlTest.php +++ b/test/classes/UrlTest.php @@ -88,7 +88,8 @@ class UrlTest extends TestCase $this->assertEquals( $expected, Url::getCommonRaw( - ['db' => 'db', 'table' => 'table'], '#ABC#' + ['db' => 'db', 'table' => 'table'], + '#ABC#' ) ); } diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 08d3e806a0..4d41ee9042 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -395,7 +395,8 @@ class UtilTest extends PmaTestCase public function testContainsNonPrintableAscii($str, $res) { $this->assertEquals( - $res, Util::containsNonPrintableAscii($str) + $res, + Util::containsNonPrintableAscii($str) ); } @@ -429,7 +430,8 @@ class UtilTest extends PmaTestCase public function testConvertBitDefaultValue($bit, $val) { $this->assertEquals( - $val, Util::convertBitDefaultValue($bit) + $val, + Util::convertBitDefaultValue($bit) ); } @@ -480,7 +482,8 @@ class UtilTest extends PmaTestCase public function testEscapeMysqlWildcards($a, $b) { $this->assertEquals( - $a, Util::escapeMysqlWildcards($b) + $a, + Util::escapeMysqlWildcards($b) ); } @@ -498,7 +501,8 @@ class UtilTest extends PmaTestCase public function testUnescapeMysqlWildcards($a, $b) { $this->assertEquals( - $b, Util::unescapeMysqlWildcards($a) + $b, + Util::unescapeMysqlWildcards($a) ); } @@ -529,13 +533,15 @@ class UtilTest extends PmaTestCase $out = str_replace('PMA_VERSION', PMA_VERSION, $out); $this->assertEquals( - $out, Util::expandUserString($in) + $out, + Util::expandUserString($in) ); $this->assertEquals( htmlspecialchars($out), Util::expandUserString( - $in, 'htmlspecialchars' + $in, + 'htmlspecialchars' ) ); } @@ -573,7 +579,8 @@ class UtilTest extends PmaTestCase $GLOBALS['cfg']['LimitChars'] = 1000; $this->assertEquals( - $out, Util::extractColumnSpec($in) + $out, + Util::extractColumnSpec($in) ); } @@ -743,7 +750,8 @@ class UtilTest extends PmaTestCase $GLOBALS['server'] = 1; $this->assertEquals( - $e, Util::isForeignKeySupported($a) + $e, + Util::isForeignKeySupported($a) ); } @@ -843,7 +851,10 @@ class UtilTest extends PmaTestCase $this->assertEquals( $d, (string) Util::formatNumber( - $a, $b, $c, false + $a, + $b, + $c, + false ) ); } @@ -996,7 +1007,8 @@ class UtilTest extends PmaTestCase $this->assertEquals( '<a href="' . Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + $GLOBALS['cfg']['DefaultTabDatabase'], + 'database' ) . '?db=' . $database . '&server=99&lang=en" ' @@ -1021,7 +1033,8 @@ class UtilTest extends PmaTestCase $database = 'test_database'; $this->assertEquals( '<a href="' . Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + $GLOBALS['cfg']['DefaultTabDatabase'], + 'database' ) . '?db=' . $database . '&server=99&lang=en" title="Jump to database “' @@ -1046,7 +1059,8 @@ class UtilTest extends PmaTestCase $this->assertEquals( '<a href="' . Util::getScriptNameForOption( - $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + $GLOBALS['cfg']['DefaultTabDatabase'], + 'database' ) . '?db=' . htmlspecialchars(urlencode($database)) @@ -1099,7 +1113,6 @@ class UtilTest extends PmaTestCase "<root><div id=\"$id\" style=\"display: none; overflow:auto;\" class=\"pma_auto_slider\"\ntitle=\"" . htmlspecialchars($message) . "\" >\n</div></root>" ); - } /** @@ -1143,7 +1156,10 @@ class UtilTest extends PmaTestCase $this->assertEquals( $result, Util::getDropdown( - $name, $choices, $active_choice, $id + $name, + $choices, + $active_choice, + $id ) ); } @@ -1176,7 +1192,10 @@ class UtilTest extends PmaTestCase $this->assertEquals( $result, Util::getDropdown( - $name, $choices, $active_choice, $id + $name, + $choices, + $active_choice, + $id ) ); } @@ -1211,7 +1230,10 @@ class UtilTest extends PmaTestCase $this->assertEquals( $result, Util::getDropdown( - $name, $choices, $active_choice, $id + $name, + $choices, + $active_choice, + $id ) ); } @@ -1410,7 +1432,9 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice + $name, + $choices, + $checked_choice ), $out ); @@ -1452,7 +1476,12 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice, true, false, $class + $name, + $choices, + $checked_choice, + true, + false, + $class ), $out ); @@ -1487,7 +1516,10 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice, false + $name, + $choices, + $checked_choice, + false ), $out ); @@ -1524,7 +1556,11 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice, true, true + $name, + $choices, + $checked_choice, + true, + true ), $out ); @@ -1561,7 +1597,11 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice, true, false + $name, + $choices, + $checked_choice, + true, + false ), $out ); @@ -1603,7 +1643,12 @@ class UtilTest extends PmaTestCase $this->assertEquals( Util::getRadioFields( - $name, $choices, $checked_choice, true, true, $class + $name, + $choices, + $checked_choice, + true, + true, + $class ), $out ); @@ -1623,7 +1668,8 @@ class UtilTest extends PmaTestCase public function testGetTitleForTarget($target, $result) { $this->assertEquals( - $result, Util::getTitleForTarget($target) + $result, + Util::getTitleForTarget($target) ); } @@ -1665,7 +1711,8 @@ class UtilTest extends PmaTestCase date_default_timezone_set('Europe/London'); $this->assertEquals( - $e, Util::localisedDate($a, $b) + $e, + Util::localisedDate($a, $b) ); date_default_timezone_set($tmpTimezone); @@ -1702,7 +1749,8 @@ class UtilTest extends PmaTestCase date_default_timezone_set('Europe/London'); $this->assertEquals( - $e, Util::timespanFormat($a) + $e, + Util::timespanFormat($a) ); date_default_timezone_set($tmpTimezone); @@ -1736,7 +1784,8 @@ class UtilTest extends PmaTestCase public function testPrintableBitValue($a, $b, $e) { $this->assertEquals( - $e, Util::printableBitValue($a, $b) + $e, + Util::printableBitValue($a, $b) ); } @@ -1771,7 +1820,8 @@ class UtilTest extends PmaTestCase public function testUnQuote($param, $expected) { $this->assertEquals( - $expected, Util::unQuote($param) + $expected, + Util::unQuote($param) ); } @@ -1804,7 +1854,8 @@ class UtilTest extends PmaTestCase public function testUnQuoteSelectedChar($param, $expected) { $this->assertEquals( - $expected, Util::unQuote($param, '"') + $expected, + Util::unQuote($param, '"') ); } @@ -1965,7 +2016,8 @@ class UtilTest extends PmaTestCase . __('Documentation') . '" class="icon ic_b_help" /></a>'; $this->assertEquals( - $expected, Util::showPHPDocu($target) + $expected, + Util::showPHPDocu($target) ); } @@ -2014,7 +2066,8 @@ class UtilTest extends PmaTestCase public function testDuplicateFirstNewline($a, $e) { $this->assertEquals( - $e, Util::duplicateFirstNewline($a) + $e, + Util::duplicateFirstNewline($a) ); } @@ -2044,7 +2097,8 @@ class UtilTest extends PmaTestCase { $no_support_types = []; $this->assertEquals( - $no_support_types, Util::unsupportedDatatypes() + $no_support_types, + Util::unsupportedDatatypes() ); } diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index aea6c86615..350e2a642a 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -157,7 +157,6 @@ class VersionInformationTest extends PmaTestCase $compatible = $mockVersionInfo ->getLatestCompatibleVersion($this->_releases); $this->assertEquals('4.4.14.1', $compatible['version']); - } /** diff --git a/test/classes/ZipExtensionTest.php b/test/classes/ZipExtensionTest.php index 2b10188561..7219713d41 100644 --- a/test/classes/ZipExtensionTest.php +++ b/test/classes/ZipExtensionTest.php @@ -134,13 +134,15 @@ class ZipExtensionTest extends PmaTestCase $this->assertEquals( false, $this->zipExtension->extract( - './test/test_data/test.zip', 'wrongName' + './test/test_data/test.zip', + 'wrongName' ) ); $this->assertEquals( "TEST FILE\n", $this->zipExtension->extract( - './test/test_data/test.zip', 'test.file' + './test/test_data/test.zip', + 'test.file' ) ); } diff --git a/test/selenium/CreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php index 83a433c2df..3e3474765e 100644 --- a/test/selenium/CreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -54,7 +54,7 @@ class CreateDropDatabaseTest extends TestBase 'DROP DATABASE IF EXISTS ' . $this->database_name . ';' ); - $this->waitForElement('byPartialLinkText','Databases')->click(); + $this->waitForElement('byPartialLinkText', 'Databases')->click(); $this->waitAjax(); $element = $this->waitForElement('byId', 'text_create_db'); @@ -99,7 +99,8 @@ class CreateDropDatabaseTest extends TestBase ); $this->waitForElement( - "byCssSelector", "span.ajax_notification div.success" + "byCssSelector", + "span.ajax_notification div.success" ); $result = $this->dbQuery( diff --git a/test/selenium/DbEventsTest.php b/test/selenium/DbEventsTest.php index 3f6a630459..8b163aecd4 100644 --- a/test/selenium/DbEventsTest.php +++ b/test/selenium/DbEventsTest.php @@ -220,7 +220,8 @@ class DbEventsTest extends TestBase $this->byPartialLinkText("Drop")->click(); $this->waitForElement( - "byClassName", "submitOK" + "byClassName", + "submitOK" )->click(); $this->waitAjaxMessage(); diff --git a/test/selenium/DbOperationsTest.php b/test/selenium/DbOperationsTest.php index 521f91b0cb..0e0ab3d86e 100644 --- a/test/selenium/DbOperationsTest.php +++ b/test/selenium/DbOperationsTest.php @@ -42,7 +42,8 @@ class DbOperationsTest extends TestBase $this->waitForElement('byPartialLinkText', 'Operations')->click(); $this->waitForElement( - 'byXPath', '//legend[contains(., \'Rename database to\')]' + 'byXPath', + '//legend[contains(., \'Rename database to\')]' ); } @@ -91,7 +92,8 @@ class DbOperationsTest extends TestBase $this->byCssSelector("form#rename_db_form input[type='submit']")->click(); $this->waitForElement( - "byCssSelector", "button.submitOK" + "byCssSelector", + "button.submitOK" )->click(); $this->waitForElement( diff --git a/test/selenium/DbProceduresTest.php b/test/selenium/DbProceduresTest.php index a0fb86b7b2..2b620390c9 100644 --- a/test/selenium/DbProceduresTest.php +++ b/test/selenium/DbProceduresTest.php @@ -35,7 +35,6 @@ class DbProceduresTest extends TestBase . " PRIMARY KEY (`id`)" . ")" ); - } /** @@ -176,7 +175,8 @@ class DbProceduresTest extends TestBase $this->byPartialLinkText("Drop")->click(); $this->waitForElement( - "byCssSelector", "button.submitOK" + "byCssSelector", + "button.submitOK" )->click(); $this->waitAjaxMessage(); diff --git a/test/selenium/DbStructureTest.php b/test/selenium/DbStructureTest.php index d430354ac8..12e6021adf 100644 --- a/test/selenium/DbStructureTest.php +++ b/test/selenium/DbStructureTest.php @@ -114,6 +114,5 @@ class DbStructureTest extends TestBase $result = $this->dbQuery("SHOW TABLES;"); $this->assertEquals(0, $result->num_rows); - } } diff --git a/test/selenium/DbTriggersTest.php b/test/selenium/DbTriggersTest.php index 738bb63626..036c5cd3e9 100644 --- a/test/selenium/DbTriggersTest.php +++ b/test/selenium/DbTriggersTest.php @@ -199,7 +199,8 @@ class DbTriggersTest extends TestBase $this->byPartialLinkText("Drop")->click(); $this->waitForElement( - "byCssSelector", "button.submitOK" + "byCssSelector", + "button.submitOK" )->click(); $this->waitAjaxMessage(); diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index 1bfc8ea1d0..2d77cce0ff 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -68,7 +68,6 @@ class ExportTest extends TestBase foreach ($expected as $str) { $this->assertContains($str, $text); } - } /** diff --git a/test/selenium/NormalizationTest.php b/test/selenium/NormalizationTest.php index 76b83789ae..1bacfbb23b 100644 --- a/test/selenium/NormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -78,7 +78,8 @@ class NormalizationTest extends TestBase ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', 'input[id=normalizeTo_1nf][type=radio]:checked' + 'byCssSelector', + 'input[id=normalizeTo_1nf][type=radio]:checked' ) ); $this->byCssSelector('input[name=submit_normalize]')->click(); @@ -99,32 +100,38 @@ class NormalizationTest extends TestBase ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#mainContent h4' + 'byCssSelector', + '#mainContent h4' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#mainContent #newCols' + 'byCssSelector', + '#mainContent #newCols' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '.tblFooters' + 'byCssSelector', + '.tblFooters' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#selectNonAtomicCol option[value=val2]' + 'byCssSelector', + '#selectNonAtomicCol option[value=val2]' ) ); $this->assertFalse( $this->isElementPresent( - 'byCssSelector', '#selectNonAtomicCol option[value=val]' + 'byCssSelector', + '#selectNonAtomicCol option[value=val]' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#selectNonAtomicCol option[value=no_such_col]' + 'byCssSelector', + '#selectNonAtomicCol option[value=no_such_col]' ) ); $this->select( @@ -147,17 +154,20 @@ class NormalizationTest extends TestBase ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#mainContent #extra' + 'byCssSelector', + '#mainContent #extra' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#extra input[value=val2][type=checkbox]' + 'byCssSelector', + '#extra input[value=val2][type=checkbox]' ) ); $this->assertTrue( $this->isElementPresent( - 'byCssSelector', '#extra input[value=id][type=checkbox]' + 'byCssSelector', + '#extra input[value=id][type=checkbox]' ) ); $this->byCssSelector('#extra input[value=val][type=checkbox]')->click(); diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index dbc547554d..16fe82cd8b 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -34,7 +34,8 @@ class SettingsTest extends TestBase $this->waitAjax(); $this->waitForElement( - "byXPath", "//a[@class='tabactive' and contains(., 'Settings')]" + "byXPath", + "//a[@class='tabactive' and contains(., 'Settings')]" ); } @@ -54,12 +55,11 @@ class SettingsTest extends TestBase $this->moveto($ele); $ele->click(); - $this->waitUntil(function() { - if ( - $this->isElementPresent( - "byXPath", - "//div[@class='success' and contains(., 'Configuration has been saved')]" - ) + $this->waitUntil(function () { + if ($this->isElementPresent( + "byXPath", + "//div[@class='success' and contains(., 'Configuration has been saved')]" + ) ) { return true; } @@ -154,5 +154,4 @@ class SettingsTest extends TestBase $this->isElementPresent("byId", "imgpmalogo") ); } - } diff --git a/test/selenium/SqlQueryTest.php b/test/selenium/SqlQueryTest.php index b615906484..e7c28a52d5 100644 --- a/test/selenium/SqlQueryTest.php +++ b/test/selenium/SqlQueryTest.php @@ -174,7 +174,7 @@ class SqlQueryTest extends TestBase { $this->waitForElement('byCssSelector', 'a.inline_edit_sql')->click(); // empty current query - $this->typeInTextArea('', 1); + $this->typeInTextArea('', 1); // type in next sql query $this->typeInTextArea('SELECT 1', 1); diff --git a/test/selenium/TableBrowseTest.php b/test/selenium/TableBrowseTest.php index ed6d4789da..12683a70b0 100644 --- a/test/selenium/TableBrowseTest.php +++ b/test/selenium/TableBrowseTest.php @@ -238,7 +238,8 @@ class TableBrowseTest extends TestBase $this->waitAjax(); $success = $this->waitForElement( - "byCssSelector", "span.ajax_notification div.success" + "byCssSelector", + "span.ajax_notification div.success" ); $this->assertContains("1 row affected", $success->text()); @@ -360,9 +361,9 @@ class TableBrowseTest extends TestBase $this->assertFalse( $this->isElementPresent( - "byCssSelector", "table.table_results tbody tr:nth-child(2)" + "byCssSelector", + "table.table_results tbody tr:nth-child(2)" ) ); - } } diff --git a/test/selenium/TableCreateTest.php b/test/selenium/TableCreateTest.php index 2e947ddb90..c7dfb0bf31 100644 --- a/test/selenium/TableCreateTest.php +++ b/test/selenium/TableCreateTest.php @@ -27,7 +27,7 @@ class TableCreateTest extends TestBase parent::setUpPage(); $this->login(); - $this->waitForElement('byPartialLinkText','Databases')->click(); + $this->waitForElement('byPartialLinkText', 'Databases')->click(); $this->waitAjax(); // go to specific database page diff --git a/test/selenium/TableInsertTest.php b/test/selenium/TableInsertTest.php index 9d05bc66ca..d3002b1a8f 100644 --- a/test/selenium/TableInsertTest.php +++ b/test/selenium/TableInsertTest.php @@ -36,7 +36,6 @@ class TableInsertTest extends TestBase . " PRIMARY KEY (`id`)" . ")" ); - } /** diff --git a/test/selenium/TableStructureTest.php b/test/selenium/TableStructureTest.php index cd7fababdb..2dde75949b 100644 --- a/test/selenium/TableStructureTest.php +++ b/test/selenium/TableStructureTest.php @@ -154,7 +154,8 @@ class TableStructureTest extends TestBase )->click(); $this->waitForElement( - "byCssSelector", "input[id='buttonYes']" + "byCssSelector", + "input[id='buttonYes']" )->click(); $this->waitForElement( @@ -166,7 +167,8 @@ class TableStructureTest extends TestBase $this->assertFalse( $this->isElementPresent( - 'byCssSelector', 'label[for=checkbox_row_2]' + 'byCssSelector', + 'label[for=checkbox_row_2]' ) ); } diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index feb194ef6a..653a10ac51 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -364,7 +364,8 @@ abstract class TestBase extends Selenium2TestCase public function isLoggedIn() { return $this->isElementPresent( - 'byXPath', '//*[@id="serverinfo"]/a[1]' + 'byXPath', + '//*[@id="serverinfo"]/a[1]' ); } @@ -392,14 +393,16 @@ abstract class TestBase extends Selenium2TestCase { try { return call_user_func_array( - [$this, $func], [$arg] + [$this, $func], + [$arg] ); - } catch(\Exception $e) { + } catch (\Exception $e) { // Element not present, fall back to waiting } $this->timeouts()->implicitWait(10000); $element = call_user_func_array( - [$this, $func], [$arg] + [$this, $func], + [$arg] ); $this->timeouts()->implicitWait(0); return $element; @@ -435,7 +438,8 @@ abstract class TestBase extends Selenium2TestCase { try { $element = call_user_func_array( - [$this, $func], [$arg] + [$this, $func], + [$arg] ); } catch (WebDriverException $e) { // Element not present @@ -556,7 +560,7 @@ abstract class TestBase extends Selenium2TestCase * * @return void */ - public function typeInTextArea($text, $index=0) + public function typeInTextArea($text, $index = 0) { $this->waitForElement('byCssSelector', 'div.cm-s-default'); $this->execute( @@ -632,7 +636,7 @@ abstract class TestBase extends Selenium2TestCase } // Go to server databases - $this->waitForElement('byPartialLinkText','Databases')->click(); + $this->waitForElement('byPartialLinkText', 'Databases')->click(); $this->waitAjax(); // go to specific database page @@ -768,7 +772,7 @@ abstract class TestBase extends Selenium2TestCase if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } - curl_close ($ch); + curl_close($ch); } // Call parent's onNotSuccessful to handle everything else diff --git a/test/selenium/TrackingTest.php b/test/selenium/TrackingTest.php index 6221a70f58..1dd128b8d8 100644 --- a/test/selenium/TrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -164,7 +164,8 @@ class TrackingTest extends TestBase { $this->byCssSelector("input[value='Deactivate now']")->click(); $this->waitForElement( - "byCssSelector", "input[value='Activate now']" + "byCssSelector", + "input[value='Activate now']" ); $this->_executeSqlAndReturnToTableTracking(); $this->assertFalse( |