diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2020-10-05 16:36:05 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2020-10-05 16:37:07 +0300 |
commit | e66be179ca66fbfcad6250a3e66424996b23f04c (patch) | |
tree | c2b4e8984eb8df6a0418b2399b1a9ea720591ab4 /test/selenium | |
parent | 153f88bcc844050bc0de7721668c50aecaf0524b (diff) |
Use camel case naming for class members
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test/selenium')
-rw-r--r-- | test/selenium/CreateDropDatabaseTest.php | 16 | ||||
-rw-r--r-- | test/selenium/Database/EventsTest.php | 24 | ||||
-rw-r--r-- | test/selenium/Database/OperationsTest.php | 12 | ||||
-rw-r--r-- | test/selenium/Database/ProceduresTest.php | 12 | ||||
-rw-r--r-- | test/selenium/Database/QueryByExampleTest.php | 4 | ||||
-rw-r--r-- | test/selenium/Database/StructureTest.php | 8 | ||||
-rw-r--r-- | test/selenium/Database/TriggersTest.php | 28 | ||||
-rw-r--r-- | test/selenium/ExportTest.php | 8 | ||||
-rw-r--r-- | test/selenium/ImportTest.php | 14 | ||||
-rw-r--r-- | test/selenium/NormalizationTest.php | 2 | ||||
-rw-r--r-- | test/selenium/ServerSettingsTest.php | 6 | ||||
-rw-r--r-- | test/selenium/SqlQueryTest.php | 4 | ||||
-rw-r--r-- | test/selenium/Table/BrowseTest.php | 2 | ||||
-rw-r--r-- | test/selenium/Table/CreateTest.php | 2 | ||||
-rw-r--r-- | test/selenium/Table/InsertTest.php | 2 | ||||
-rw-r--r-- | test/selenium/Table/OperationsTest.php | 20 | ||||
-rw-r--r-- | test/selenium/Table/StructureTest.php | 2 | ||||
-rw-r--r-- | test/selenium/TestBase.php | 10 | ||||
-rw-r--r-- | test/selenium/TrackingTest.php | 6 |
19 files changed, 91 insertions, 91 deletions
diff --git a/test/selenium/CreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php index 8d05722ac0..fc69905ac9 100644 --- a/test/selenium/CreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -33,7 +33,7 @@ class CreateDropDatabaseTest extends TestBase public function testCreateDropDatabase(): void { $this->dbQuery( - 'DROP DATABASE IF EXISTS `' . $this->database_name . '`;' + 'DROP DATABASE IF EXISTS `' . $this->databaseName . '`;' ); $this->waitForElement('partialLinkText', 'Databases')->click(); @@ -41,17 +41,17 @@ class CreateDropDatabaseTest extends TestBase $element = $this->waitForElement('id', 'text_create_db'); $element->clear(); - $element->sendKeys($this->database_name); + $element->sendKeys($this->databaseName); $this->byId('buttonGo')->click(); - $this->waitForElement('linkText', 'Database: ' . $this->database_name); + $this->waitForElement('linkText', 'Database: ' . $this->databaseName); $this->dbQuery( - 'SHOW DATABASES LIKE \'' . $this->database_name . '\';', + 'SHOW DATABASES LIKE \'' . $this->databaseName . '\';', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); - $this->assertEquals($this->database_name, $this->getCellByTableClass('table_results', 1, 1)); + $this->assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); } ); @@ -71,7 +71,7 @@ class CreateDropDatabaseTest extends TestBase $this->scrollToBottom(); $dbElement = $this->byCssSelector( - "input[name='selected_dbs[]'][value='" . $this->database_name . "']" + "input[name='selected_dbs[]'][value='" . $this->databaseName . "']" ); $this->scrollToElement($dbElement, 0, 20); $dbElement->click(); @@ -83,7 +83,7 @@ class CreateDropDatabaseTest extends TestBase $this->waitForElementNotPresent( 'cssSelector', - "input[name='selected_dbs[]'][value='" . $this->database_name . "']" + "input[name='selected_dbs[]'][value='" . $this->databaseName . "']" ); $this->waitForElement( @@ -92,7 +92,7 @@ class CreateDropDatabaseTest extends TestBase ); $this->dbQuery( - 'SHOW DATABASES LIKE \'' . $this->database_name . '\';', + 'SHOW DATABASES LIKE \'' . $this->databaseName . '\';', function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); } diff --git a/test/selenium/Database/EventsTest.php b/test/selenium/Database/EventsTest.php index 58b341589b..69f814ba53 100644 --- a/test/selenium/Database/EventsTest.php +++ b/test/selenium/Database/EventsTest.php @@ -26,7 +26,7 @@ class EventsTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -36,7 +36,7 @@ class EventsTest extends TestBase . 'SET GLOBAL event_scheduler="ON";' ); $this->login(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); // Let the Database page load $this->waitAjax(); @@ -61,10 +61,10 @@ class EventsTest extends TestBase $end = date('Y-m-d H:i:s', strtotime('+1 day')); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE EVENT `test_event` ON SCHEDULE EVERY 1 MINUTE_SECOND STARTS ' . "'" . $start . "' ENDS '" . $end . "' ON COMPLETION NOT PRESERVE ENABLE " - . 'DO UPDATE `' . $this->database_name + . 'DO UPDATE `' . $this->databaseName . '`.`test_table` SET val = val + 1', null, function (): void { @@ -103,7 +103,7 @@ class EventsTest extends TestBase $this->waitForElement('name', 'item_interval_value')->click()->clear()->sendKeys('1'); - $proc = 'UPDATE ' . $this->database_name . '.`test_table` SET val=val+1'; + $proc = 'UPDATE ' . $this->databaseName . '.`test_table` SET val=val+1'; $this->typeInTextArea($proc); $action = $this->webDriver->action(); @@ -140,11 +140,11 @@ class EventsTest extends TestBase ); $this->dbQuery( - 'USE `' . $this->database_name . '`;' - . 'SHOW EVENTS WHERE Db=\'' . $this->database_name . '\' AND Name=\'test_event\';', + 'USE `' . $this->databaseName . '`;' + . 'SHOW EVENTS WHERE Db=\'' . $this->databaseName . '\' AND Name=\'test_event\';', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); - $this->assertEquals($this->database_name, $this->getCellByTableClass('table_results', 1, 1)); + $this->assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); $this->assertEquals('test_event', $this->getCellByTableClass('table_results', 1, 2)); $this->assertEquals('RECURRING', $this->getCellByTableClass('table_results', 1, 5)); } @@ -152,7 +152,7 @@ class EventsTest extends TestBase sleep(2); $this->dbQuery( - 'SELECT val FROM `' . $this->database_name . '`.`test_table`', + 'SELECT val FROM `' . $this->databaseName . '`.`test_table`', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | <number> @@ -194,7 +194,7 @@ class EventsTest extends TestBase sleep(2); $this->dbQuery( - 'SELECT val FROM `' . $this->database_name . '`.`test_table`', + 'SELECT val FROM `' . $this->databaseName . '`.`test_table`', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 4 @@ -229,8 +229,8 @@ class EventsTest extends TestBase $this->waitAjaxMessage(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' - . 'SHOW EVENTS WHERE Db=\'' . $this->database_name . '\' AND Name=\'test_event\';', + 'USE `' . $this->databaseName . '`;' + . 'SHOW EVENTS WHERE Db=\'' . $this->databaseName . '\' AND Name=\'test_event\';', function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); } diff --git a/test/selenium/Database/OperationsTest.php b/test/selenium/Database/OperationsTest.php index c6fc063287..fcf549997c 100644 --- a/test/selenium/Database/OperationsTest.php +++ b/test/selenium/Database/OperationsTest.php @@ -29,7 +29,7 @@ class OperationsTest extends TestBase { $this->gotoHomepage(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $this->expandMore(); $this->waitForElement('partialLinkText', 'Operations')->click(); $this->waitForElement( @@ -70,7 +70,7 @@ class OperationsTest extends TestBase { $this->getToDBOperations(); - $new_db_name = $this->database_name . 'rename'; + $new_db_name = $this->databaseName . 'rename'; $this->scrollIntoView('create_table_form_minimal'); $this->byCssSelector('form#rename_db_form input[name=newname]') @@ -97,13 +97,13 @@ class OperationsTest extends TestBase ); $this->dbQuery( - 'SHOW DATABASES LIKE \'' . $this->database_name . '\'', + 'SHOW DATABASES LIKE \'' . $this->databaseName . '\'', function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); } ); - $this->database_name = $new_db_name; + $this->databaseName = $new_db_name; } /** @@ -116,7 +116,7 @@ class OperationsTest extends TestBase $this->getToDBOperations(); $this->reloadPage();// Reload or scrolling will not work .. - $new_db_name = $this->database_name . 'copy'; + $new_db_name = $this->databaseName . 'copy'; $this->byCssSelector('form#copy_db_form input[name=newname]') ->sendKeys($new_db_name); @@ -126,7 +126,7 @@ class OperationsTest extends TestBase $this->waitForElement( 'xpath', "//div[@class='alert alert-success' and contains(., 'Database " - . $this->database_name + . $this->databaseName . ' has been copied to ' . $new_db_name . "')]" ); diff --git a/test/selenium/Database/ProceduresTest.php b/test/selenium/Database/ProceduresTest.php index 59c7f6b190..60dbb7b609 100644 --- a/test/selenium/Database/ProceduresTest.php +++ b/test/selenium/Database/ProceduresTest.php @@ -44,7 +44,7 @@ class ProceduresTest extends TestBase } $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `name` varchar(20) NOT NULL,' @@ -55,7 +55,7 @@ class ProceduresTest extends TestBase $this->login(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $this->expandMore(); } @@ -107,7 +107,7 @@ class ProceduresTest extends TestBase private function procedureSQL(): void { $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE PROCEDURE `test_procedure`(IN `inp` VARCHAR(20), OUT `outp` INT)' . ' NOT DETERMINISTIC READS SQL DATA SQL SECURITY DEFINER SELECT char_' . 'length(inp) + count(*) FROM test_table INTO outp' @@ -163,10 +163,10 @@ class ProceduresTest extends TestBase ); $this->dbQuery( - "SHOW PROCEDURE STATUS WHERE Db='" . $this->database_name . "'", + "SHOW PROCEDURE STATUS WHERE Db='" . $this->databaseName . "'", function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); - $this->assertEquals($this->database_name, $this->getCellByTableClass('table_results', 1, 1)); + $this->assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); } ); @@ -230,7 +230,7 @@ class ProceduresTest extends TestBase $this->waitAjaxMessage(); $this->dbQuery( - "SHOW PROCEDURE STATUS WHERE Db='" . $this->database_name . "'", + "SHOW PROCEDURE STATUS WHERE Db='" . $this->databaseName . "'", function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); } diff --git a/test/selenium/Database/QueryByExampleTest.php b/test/selenium/Database/QueryByExampleTest.php index 746cda8927..3de14dc6b3 100644 --- a/test/selenium/Database/QueryByExampleTest.php +++ b/test/selenium/Database/QueryByExampleTest.php @@ -26,7 +26,7 @@ class QueryByExampleTest extends TestBase parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -43,7 +43,7 @@ class QueryByExampleTest extends TestBase */ public function testQueryByExample(): void { - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $this->waitForElement('partialLinkText', 'Query')->click(); $this->waitAjax(); diff --git a/test/selenium/Database/StructureTest.php b/test/selenium/Database/StructureTest.php index 549af786e5..c5807cb732 100644 --- a/test/selenium/Database/StructureTest.php +++ b/test/selenium/Database/StructureTest.php @@ -23,7 +23,7 @@ class StructureTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -38,7 +38,7 @@ class StructureTest extends TestBase ); $this->login(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); // Let the Database page load $this->waitAjax(); @@ -68,7 +68,7 @@ class StructureTest extends TestBase ); $this->dbQuery( - 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->database_name . '`.`test_table`', + 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->databaseName . '`.`test_table`', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 5 @@ -100,7 +100,7 @@ class StructureTest extends TestBase ); $this->dbQuery( - 'SHOW TABLES FROM `' . $this->database_name . '`;', + 'SHOW TABLES FROM `' . $this->databaseName . '`;', function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); } diff --git a/test/selenium/Database/TriggersTest.php b/test/selenium/Database/TriggersTest.php index db07c8258d..6185f39935 100644 --- a/test/selenium/Database/TriggersTest.php +++ b/test/selenium/Database/TriggersTest.php @@ -23,7 +23,7 @@ class TriggersTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -39,7 +39,7 @@ class TriggersTest extends TestBase $this->login(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); } /** @@ -48,10 +48,10 @@ class TriggersTest extends TestBase private function triggerSQL(): void { $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TRIGGER `test_trigger` ' . 'AFTER INSERT ON `test_table` FOR EACH ROW' - . ' UPDATE `' . $this->database_name + . ' UPDATE `' . $this->databaseName . '`.`test_table2` SET val = val + 1', null, function (): void { @@ -94,7 +94,7 @@ class TriggersTest extends TestBase 'INSERT' ); - $proc = 'UPDATE ' . $this->database_name . '.`test_table2` SET val=val+1'; + $proc = 'UPDATE ' . $this->databaseName . '.`test_table2` SET val=val+1'; $this->typeInTextArea($proc); $this->byXPath("//button[contains(., 'Go')]")->click(); @@ -113,7 +113,7 @@ class TriggersTest extends TestBase ); $this->dbQuery( - 'SHOW TRIGGERS FROM `' . $this->database_name . '`;', + 'SHOW TRIGGERS FROM `' . $this->databaseName . '`;', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('test_trigger', $this->getCellByTableClass('table_results', 1, 1)); @@ -122,11 +122,11 @@ class TriggersTest extends TestBase // test trigger $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'INSERT INTO `test_table` (val) VALUES (1);' ); $this->dbQuery( - 'SELECT val FROM `' . $this->database_name . '`.`test_table2`;', + 'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 3 @@ -156,7 +156,7 @@ class TriggersTest extends TestBase $this->byPartialLinkText('Edit')->click(); $this->waitForElement('className', 'rte_form'); - $proc = 'UPDATE ' . $this->database_name . '.`test_table2` SET val=val+10'; + $proc = 'UPDATE ' . $this->databaseName . '.`test_table2` SET val=val+10'; $this->typeInTextArea($proc); $this->byXPath("//button[contains(., 'Go')]")->click(); @@ -169,11 +169,11 @@ class TriggersTest extends TestBase // test trigger $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'INSERT INTO `test_table` (val) VALUES (1);' ); $this->dbQuery( - 'SELECT val FROM `' . $this->database_name . '`.`test_table2`;', + 'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 12 @@ -210,11 +210,11 @@ class TriggersTest extends TestBase // test trigger $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'INSERT INTO `test_table` (val) VALUES (1);' ); $this->dbQuery( - 'SELECT val FROM `' . $this->database_name . '`.`test_table2`;', + 'SELECT val FROM `' . $this->databaseName . '`.`test_table2`;', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 2 @@ -223,7 +223,7 @@ class TriggersTest extends TestBase ); $this->dbQuery( - 'SHOW TRIGGERS FROM `' . $this->database_name . '`;', + 'SHOW TRIGGERS FROM `' . $this->databaseName . '`;', function (): void { $this->assertfalse($this->isElementPresent('className', 'table_results')); } diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index c7a2c2f1e6..30d987354c 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -21,7 +21,7 @@ class ExportTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -62,7 +62,7 @@ class ExportTest extends TestBase */ public function testDbExport(string $plugin, array $expected): void { - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $text = $this->doExport('db', $plugin); @@ -82,7 +82,7 @@ class ExportTest extends TestBase */ public function testTableExport(string $plugin, array $expected): void { - $this->dbQuery('INSERT INTO `' . $this->database_name . '`.`test_table` (val) VALUES (3);'); + $this->dbQuery('INSERT INTO `' . $this->databaseName . '`.`test_table` (val) VALUES (3);'); $this->navigateTable('test_table'); @@ -144,7 +144,7 @@ class ExportTest extends TestBase $this->scrollIntoView('databases_and_tables', 200); $this->byPartialLinkText('Unselect all')->click(); - $this->byCssSelector('option[value="' . $this->database_name . '"]')->click(); + $this->byCssSelector('option[value="' . $this->databaseName . '"]')->click(); } if ($type === 'table') { diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index 0d0d8e7d38..caeb388b4b 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -55,14 +55,14 @@ class ImportTest extends TestBase */ public function testDbImport(): void { - $this->dbQuery('CREATE DATABASE IF NOT EXISTS `' . $this->database_name . '`'); - $this->navigateDatabase($this->database_name); + $this->dbQuery('CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`'); + $this->navigateDatabase($this->databaseName); $this->doImport('db'); $this->dbQuery( - 'USE `' . $this->database_name . '`;' - . 'SHOW TABLES FROM `' . $this->database_name . '`', + 'USE `' . $this->databaseName . '`;' + . 'SHOW TABLES FROM `' . $this->databaseName . '`', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('test_table', $this->getCellByTableClass('table_results', 1, 1)); @@ -79,8 +79,8 @@ class ImportTest extends TestBase { // setup the db $this->dbQuery( - 'CREATE DATABASE IF NOT EXISTS `' . $this->database_name . '`;' - . 'USE `' . $this->database_name . '`;' + 'CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`;' + . 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE IF NOT EXISTS `test_table` (`val` int(11) NOT NULL);' ); @@ -89,7 +89,7 @@ class ImportTest extends TestBase $this->doImport('table'); $this->dbQuery( - 'SELECT * FROM `' . $this->database_name . '`.test_table', + 'SELECT * FROM `' . $this->databaseName . '`.test_table', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('8', $this->getCellByTableClass('table_results', 1, 1)); diff --git a/test/selenium/NormalizationTest.php b/test/selenium/NormalizationTest.php index 25a882aa9c..cd97ea5d38 100644 --- a/test/selenium/NormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -21,7 +21,7 @@ class NormalizationTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index aa7a413c17..1dc2fa4535 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -75,17 +75,17 @@ class ServerSettingsTest extends TestBase $ele = $this->waitForElement('name', 'Servers-1-hide_db'); $this->moveto($ele); $ele->clear(); - $ele->sendKeys($this->database_name); + $ele->sendKeys($this->databaseName); $this->saveConfig(); $this->assertFalse( - $this->isElementPresent('partialLinkText', $this->database_name) + $this->isElementPresent('partialLinkText', $this->databaseName) ); $this->waitForElement('name', 'Servers-1-hide_db')->clear(); $this->saveConfig(); $this->assertTrue( - $this->isElementPresent('partialLinkText', $this->database_name) + $this->isElementPresent('partialLinkText', $this->databaseName) ); } diff --git a/test/selenium/SqlQueryTest.php b/test/selenium/SqlQueryTest.php index 996194e4d6..892e95e5f8 100644 --- a/test/selenium/SqlQueryTest.php +++ b/test/selenium/SqlQueryTest.php @@ -22,7 +22,7 @@ class SqlQueryTest extends TestBase parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -79,7 +79,7 @@ class SqlQueryTest extends TestBase */ public function testDatabaseSqlQuery(): void { - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $this->waitForElement('partialLinkText', 'SQL')->click(); $this->waitAjax(); diff --git a/test/selenium/Table/BrowseTest.php b/test/selenium/Table/BrowseTest.php index d995dd149b..1431b7afeb 100644 --- a/test/selenium/Table/BrowseTest.php +++ b/test/selenium/Table/BrowseTest.php @@ -24,7 +24,7 @@ class BrowseTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `name` varchar(20) NOT NULL,' diff --git a/test/selenium/Table/CreateTest.php b/test/selenium/Table/CreateTest.php index 9b4b861080..9c44e42c35 100644 --- a/test/selenium/Table/CreateTest.php +++ b/test/selenium/Table/CreateTest.php @@ -26,7 +26,7 @@ class CreateTest extends TestBase $this->waitAjax(); // go to specific database page - $this->waitForElement('partialLinkText', $this->database_name)->click(); + $this->waitForElement('partialLinkText', $this->databaseName)->click(); } /** diff --git a/test/selenium/Table/InsertTest.php b/test/selenium/Table/InsertTest.php index 88e7770406..7859d809db 100644 --- a/test/selenium/Table/InsertTest.php +++ b/test/selenium/Table/InsertTest.php @@ -24,7 +24,7 @@ class InsertTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `name` varchar(20) NOT NULL,' diff --git a/test/selenium/Table/OperationsTest.php b/test/selenium/Table/OperationsTest.php index 2cba7225df..8a135f0a20 100644 --- a/test/selenium/Table/OperationsTest.php +++ b/test/selenium/Table/OperationsTest.php @@ -26,7 +26,7 @@ class OperationsTest extends TestBase // MYISAM ENGINE to allow for column-based order selection // while table also has a PRIMARY key $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -109,13 +109,13 @@ class OperationsTest extends TestBase $this->waitForElement( 'xpath', "//div[@class='alert alert-success' and " - . "contains(., 'Table `" . $this->database_name + . "contains(., 'Table `" . $this->databaseName . '`.`test_table` has been ' - . 'moved to `' . $this->database_name . "`.`test_table2`.')]" + . 'moved to `' . $this->databaseName . "`.`test_table2`.')]" ); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'SHOW TABLES LIKE \'test_table2\'', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); @@ -148,7 +148,7 @@ class OperationsTest extends TestBase ); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'SHOW TABLES LIKE \'test_table2\'', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); @@ -174,13 +174,13 @@ class OperationsTest extends TestBase $this->waitForElement( 'xpath', "//div[@class='alert alert-success' and " - . "contains(., 'Table `" . $this->database_name + . "contains(., 'Table `" . $this->databaseName . '`.`test_table` has been ' - . 'copied to `' . $this->database_name . "`.`test_table2`.')]" + . 'copied to `' . $this->databaseName . "`.`test_table2`.')]" ); $this->dbQuery( - 'SELECT COUNT(*) as c FROM `' . $this->database_name . '`.test_table2', + 'SELECT COUNT(*) as c FROM `' . $this->databaseName . '`.test_table2', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('2', $this->getCellByTableClass('table_results', 1, 1)); @@ -208,7 +208,7 @@ class OperationsTest extends TestBase ); $this->dbQuery( - 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->database_name . '`.test_table', + 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->databaseName . '`.test_table', function (): void { $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); @@ -241,7 +241,7 @@ class OperationsTest extends TestBase ); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'SHOW TABLES', function (): void { $this->assertFalse($this->isElementPresent('className', 'table_results')); diff --git a/test/selenium/Table/StructureTest.php b/test/selenium/Table/StructureTest.php index 5f67e14492..ff028bfd5b 100644 --- a/test/selenium/Table/StructureTest.php +++ b/test/selenium/Table/StructureTest.php @@ -23,7 +23,7 @@ class StructureTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 03028f7078..ea61bbb689 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -71,7 +71,7 @@ abstract class TestBase extends TestCase * @access public * @var string */ - public $database_name; + public $databaseName; /** * The session Id (Browserstack) @@ -156,9 +156,9 @@ abstract class TestBase extends TestCase */ protected function createDatabase(): void { - $this->database_name = $this->getDbPrefix() . mb_substr(sha1((string) rand()), 0, 7); + $this->databaseName = $this->getDbPrefix() . mb_substr(sha1((string) rand()), 0, 7); $this->dbQuery( - 'CREATE DATABASE IF NOT EXISTS `' . $this->database_name . '`; USE `' . $this->database_name . '`;' + 'CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`; USE `' . $this->databaseName . '`;' ); static::$createDatabase = true; } @@ -920,7 +920,7 @@ abstract class TestBase extends TestCase */ public function navigateTable(string $table, bool $gotoHomepageRequired = false): void { - $this->navigateDatabase($this->database_name, $gotoHomepageRequired); + $this->navigateDatabase($this->databaseName, $gotoHomepageRequired); // go to table page $this->waitForElement( @@ -1081,7 +1081,7 @@ abstract class TestBase extends TestCase protected function tearDown(): void { if (static::$createDatabase) { - $this->dbQuery('DROP DATABASE IF EXISTS `' . $this->database_name . '`;'); + $this->dbQuery('DROP DATABASE IF EXISTS `' . $this->databaseName . '`;'); } if (! $this->hasFailed()) { $this->markTestAs('passed', ''); diff --git a/test/selenium/TrackingTest.php b/test/selenium/TrackingTest.php index a56fe839aa..195bb128a0 100644 --- a/test/selenium/TrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -21,7 +21,7 @@ class TrackingTest extends TestBase { parent::setUp(); $this->dbQuery( - 'USE `' . $this->database_name . '`;' + 'USE `' . $this->databaseName . '`;' . 'CREATE TABLE `test_table` (' . ' `id` int(11) NOT NULL AUTO_INCREMENT,' . ' `val` int(11) NOT NULL,' @@ -38,7 +38,7 @@ class TrackingTest extends TestBase $this->login(); $this->skipIfNotPMADB(); - $this->navigateDatabase($this->database_name); + $this->navigateDatabase($this->databaseName); $this->expandMore(); $this->waitForElement('partialLinkText', 'Tracking')->click(); @@ -162,7 +162,7 @@ class TrackingTest extends TestBase */ public function testDropTracking(): void { - $this->navigateDatabase($this->database_name, true); + $this->navigateDatabase($this->databaseName, true); $this->expandMore(); $this->byPartialLinkText('Tracking')->click(); |