diff --git a/tests/end-to-end/ChangePasswordTest.php b/tests/end-to-end/ChangePasswordTest.php index 2467ca9dc4..86054799ef 100644 --- a/tests/end-to-end/ChangePasswordTest.php +++ b/tests/end-to-end/ChangePasswordTest.php @@ -33,18 +33,18 @@ class ChangePasswordTest extends TestBase $this->waitForElement('xpath', "//span[contains(., 'Change password')]"); $ele = $this->waitForElement('name', 'pma_pw'); - self::assertEquals('', $ele->getAttribute('value')); + self::assertSame('', $ele->getAttribute('value')); $ele = $this->waitForElement('name', 'pma_pw2'); - self::assertEquals('', $ele->getAttribute('value')); + self::assertSame('', $ele->getAttribute('value')); $ele = $this->waitForElement('name', 'generated_pw'); - self::assertEquals('', $ele->getAttribute('value')); + self::assertSame('', $ele->getAttribute('value')); $this->byId('button_generate_password')->click(); - self::assertNotEquals('', $this->byName('pma_pw')->getAttribute('value')); - self::assertNotEquals('', $this->byName('pma_pw2')->getAttribute('value')); - self::assertNotEquals('', $this->byName('generated_pw')->getAttribute('value')); + self::assertNotSame('', $this->byName('pma_pw')->getAttribute('value')); + self::assertNotSame('', $this->byName('pma_pw2')->getAttribute('value')); + self::assertNotSame('', $this->byName('generated_pw')->getAttribute('value')); if ($this->getTestSuiteUserPassword() !== '') { $this->byName('pma_pw')->clear(); @@ -59,7 +59,7 @@ class ChangePasswordTest extends TestBase $this->byId('changePasswordGoButton')->click(); $ele = $this->waitForElement('cssSelector', '.alert-success'); - self::assertEquals( + self::assertSame( 'The profile has been updated.', trim($ele->getText()), ); diff --git a/tests/end-to-end/CreateDropDatabaseTest.php b/tests/end-to-end/CreateDropDatabaseTest.php index 33cd04c14d..9cb927dcb9 100644 --- a/tests/end-to-end/CreateDropDatabaseTest.php +++ b/tests/end-to-end/CreateDropDatabaseTest.php @@ -45,7 +45,7 @@ class CreateDropDatabaseTest extends TestBase 'SHOW DATABASES LIKE \'' . $this->databaseName . '\';', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); }, ); diff --git a/tests/end-to-end/CreateRemoveUserTest.php b/tests/end-to-end/CreateRemoveUserTest.php index 7bf072fecf..899e053ed3 100644 --- a/tests/end-to-end/CreateRemoveUserTest.php +++ b/tests/end-to-end/CreateRemoveUserTest.php @@ -68,9 +68,9 @@ class CreateRemoveUserTest extends TestBase $genButton = $this->waitForElement('id', 'button_generate_password'); $genButton->click(); - self::assertNotEquals('', $this->byId('text_pma_pw')->getAttribute('value')); - self::assertNotEquals('', $this->byId('text_pma_pw2')->getAttribute('value')); - self::assertNotEquals('', $this->byId('generated_pw')->getAttribute('value')); + self::assertNotSame('', $this->byId('text_pma_pw')->getAttribute('value')); + self::assertNotSame('', $this->byId('text_pma_pw2')->getAttribute('value')); + self::assertNotSame('', $this->byId('generated_pw')->getAttribute('value')); $this->byId('text_pma_pw')->sendKeys($this->txtPassword); $this->byId('text_pma_pw2')->sendKeys($this->txtPassword); diff --git a/tests/end-to-end/Database/EventsTest.php b/tests/end-to-end/Database/EventsTest.php index 73c47f4ff4..9c75d634a3 100644 --- a/tests/end-to-end/Database/EventsTest.php +++ b/tests/end-to-end/Database/EventsTest.php @@ -137,9 +137,9 @@ class EventsTest extends TestBase . 'SHOW EVENTS WHERE Db=\'' . $this->databaseName . '\' AND Name=\'test_event\';', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); - self::assertEquals('test_event', $this->getCellByTableClass('table_results', 1, 2)); - self::assertEquals('RECURRING', $this->getCellByTableClass('table_results', 1, 5)); + self::assertSame($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_event', $this->getCellByTableClass('table_results', 1, 2)); + self::assertSame('RECURRING', $this->getCellByTableClass('table_results', 1, 5)); }, ); diff --git a/tests/end-to-end/Database/OperationsTest.php b/tests/end-to-end/Database/OperationsTest.php index 7b2c9fa250..77bc7c24a7 100644 --- a/tests/end-to-end/Database/OperationsTest.php +++ b/tests/end-to-end/Database/OperationsTest.php @@ -69,7 +69,7 @@ class OperationsTest extends TestBase 'SHOW DATABASES LIKE \'' . $newDbName . '\'', function () use ($newDbName): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals($newDbName, $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame($newDbName, $this->getCellByTableClass('table_results', 1, 1)); }, ); @@ -111,7 +111,7 @@ class OperationsTest extends TestBase 'SHOW DATABASES LIKE \'' . $newDbName . '\'', function () use ($newDbName): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals($newDbName, $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame($newDbName, $this->getCellByTableClass('table_results', 1, 1)); }, ); diff --git a/tests/end-to-end/Database/ProceduresTest.php b/tests/end-to-end/Database/ProceduresTest.php index 05fe531f07..f99c504266 100644 --- a/tests/end-to-end/Database/ProceduresTest.php +++ b/tests/end-to-end/Database/ProceduresTest.php @@ -84,7 +84,7 @@ class ProceduresTest extends TestBase { if ($this->originalSqlMode !== '') { $this->dbQuery("SET GLOBAL sql_mode = '" . $this->originalSqlMode . "';"); - self::assertEquals( + self::assertSame( $this->originalSqlMode, $this->getSqlMode(), ); @@ -162,7 +162,7 @@ class ProceduresTest extends TestBase "SHOW PROCEDURE STATUS WHERE Db='" . $this->databaseName . "'", function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame($this->databaseName, $this->getCellByTableClass('table_results', 1, 1)); }, ); @@ -236,6 +236,6 @@ class ProceduresTest extends TestBase $this->waitUntilElementIsVisible('cssSelector', 'span#PMA_slidingMessage', 30); sleep(2);// Give more chances to the JS effect to finish $head = $this->byCssSelector('span#PMA_slidingMessage table tbody')->getText(); - self::assertEquals("outp\n" . $length, $head); + self::assertSame("outp\n" . $length, $head); } } diff --git a/tests/end-to-end/Database/StructureTest.php b/tests/end-to-end/Database/StructureTest.php index c8f365ea99..5277895855 100644 --- a/tests/end-to-end/Database/StructureTest.php +++ b/tests/end-to-end/Database/StructureTest.php @@ -59,7 +59,7 @@ class StructureTest extends TestBase function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 5 - self::assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); }, ); } diff --git a/tests/end-to-end/ImportTest.php b/tests/end-to-end/ImportTest.php index 46fe444f1b..3539c308bb 100644 --- a/tests/end-to-end/ImportTest.php +++ b/tests/end-to-end/ImportTest.php @@ -30,8 +30,8 @@ class ImportTest extends TestBase $this->dbQuery( 'SHOW DATABASES LIKE \'test_import%\'', function (): void { - self::assertEquals('test_import1', $this->getCellByTableClass('table_results', 1, 1)); - self::assertEquals('test_import2', $this->getCellByTableClass('table_results', 2, 1)); + self::assertSame('test_import1', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_import2', $this->getCellByTableClass('table_results', 2, 1)); }, ); @@ -54,7 +54,7 @@ class ImportTest extends TestBase . 'SHOW TABLES FROM `' . $this->databaseName . '`', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('test_table', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_table', $this->getCellByTableClass('table_results', 1, 1)); }, ); } @@ -79,8 +79,8 @@ class ImportTest extends TestBase 'SELECT * FROM `' . $this->databaseName . '`.test_table', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('8', $this->getCellByTableClass('table_results', 1, 1)); - self::assertEquals('9', $this->getCellByTableClass('table_results', 2, 1)); + self::assertSame('8', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('9', $this->getCellByTableClass('table_results', 2, 1)); }, ); } diff --git a/tests/end-to-end/NormalizationTest.php b/tests/end-to-end/NormalizationTest.php index 3061f525ea..9234b0855a 100644 --- a/tests/end-to-end/NormalizationTest.php +++ b/tests/end-to-end/NormalizationTest.php @@ -44,7 +44,7 @@ class NormalizationTest extends TestBase */ public function testNormalizationTo1NF(): void { - self::assertEquals( + self::assertSame( 'First step of normalization (1NF)', $this->byCssSelector('label[for=normalizeToRadio1]')->getText(), ); @@ -64,7 +64,7 @@ class NormalizationTest extends TestBase */ private function assert1NFSteps(): void { - self::assertEquals( + self::assertSame( 'First step of normalization (1NF)', $this->byCssSelector('#page_content h3')->getText(), ); diff --git a/tests/end-to-end/SqlQueryTest.php b/tests/end-to-end/SqlQueryTest.php index 754a8a6087..a85832818d 100644 --- a/tests/end-to-end/SqlQueryTest.php +++ b/tests/end-to-end/SqlQueryTest.php @@ -41,24 +41,24 @@ class SqlQueryTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( - 1, + self::assertSame( + '1', $this->getCellByTableClass('table_results', 1, 1), ); - self::assertEquals( - 1, + self::assertSame( + '1', $this->getCellByTableClass('table_results', 1, 2), ); - self::assertEquals( - 2, + self::assertSame( + '2', $this->getCellByTableClass('table_results', 1, 3), ); - self::assertEquals( - 4, + self::assertSame( + '4', $this->getCellByTableClass('table_results', 1, 4), ); - self::assertEquals( - 7, + self::assertSame( + '7', $this->getCellByTableClass('table_results', 1, 5), ); @@ -81,16 +81,16 @@ class SqlQueryTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( + self::assertSame( 'test_table', $this->getCellByTableClass('table_results', 1, 1), ); - self::assertEquals( + self::assertSame( 'InnoDB', $this->getCellByTableClass('table_results', 1, 2), ); - self::assertEquals( - 4, + self::assertSame( + '4', $this->getCellByTableClass('table_results', 1, 5), ); @@ -114,20 +114,20 @@ class SqlQueryTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( - 3, + self::assertSame( + '3', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( - 4, + self::assertSame( + '4', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( - 4, + self::assertSame( + '4', $this->getCellByTableClass('table_results', 1, 6), ); - self::assertEquals( - 5, + self::assertSame( + '5', $this->getCellByTableClass('table_results', 2, 6), ); @@ -149,8 +149,8 @@ class SqlQueryTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( - 1, + self::assertSame( + '1', $this->getCellByTableClass('table_results', 1, 1), ); } diff --git a/tests/end-to-end/Table/BrowseTest.php b/tests/end-to-end/Table/BrowseTest.php index fb77d792e7..f460dd0f27 100644 --- a/tests/end-to-end/Table/BrowseTest.php +++ b/tests/end-to-end/Table/BrowseTest.php @@ -49,17 +49,17 @@ class BrowseTest extends TestBase $this->byPartialLinkText('name')->click(); $this->waitAjax(); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( '3', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 3, 5), ); @@ -68,17 +68,17 @@ class BrowseTest extends TestBase $this->byPartialLinkText('name')->click(); $this->waitAjax(); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( + self::assertSame( '3', $this->getCellByTableClass('table_results', 3, 5), ); @@ -88,17 +88,17 @@ class BrowseTest extends TestBase $this->waitAjax(); $this->getCellByTableClass('table_results', 1, 5); - self::assertEquals( + self::assertSame( '3', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 3, 5), ); @@ -107,17 +107,17 @@ class BrowseTest extends TestBase $this->byPartialLinkText('datetimefield')->click(); $this->waitAjax(); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( + self::assertSame( '3', $this->getCellByTableClass('table_results', 3, 5), ); @@ -137,17 +137,17 @@ class BrowseTest extends TestBase $this->waitAjax(); $this->waitForElement('id', 'insertForm'); - self::assertEquals( + self::assertSame( '2', $this->byId('field_1_3')->getAttribute('value'), ); - self::assertEquals( + self::assertSame( 'foo', $this->byId('field_2_3')->getAttribute('value'), ); - self::assertEquals( + self::assertSame( '2010-01-20 02:00:02', $this->byId('field_3_3')->getAttribute('value'), ); @@ -166,12 +166,12 @@ class BrowseTest extends TestBase $success = $this->waitForElement('className', 'alert-success'); self::assertStringContainsString('1 row affected', $success->getText()); - self::assertEquals( + self::assertSame( 'foobar', $this->getCellByTableClass('table_results', 2, 6), ); - self::assertEquals( + self::assertSame( '2009-01-02 00:00:00', $this->getCellByTableClass('table_results', 2, 7), ); @@ -187,7 +187,7 @@ class BrowseTest extends TestBase $this->moveto($element); $this->doubleclick(); - self::assertEquals( + self::assertSame( $this->waitForElement( 'xpath', "//div[not(contains(@style,'display: none;'))]//textarea[contains(@class, 'edit_box')]", @@ -204,7 +204,7 @@ class BrowseTest extends TestBase $success = $this->waitForElement('cssSelector', 'span.ajax_notification .alert-success'); self::assertStringContainsString('1 row affected', $success->getText()); - self::assertEquals( + self::assertSame( 'abcde', $this->getCellByTableClass('table_results', 1, 6), ); @@ -220,12 +220,12 @@ class BrowseTest extends TestBase $this->click(); $this->waitForElement('id', 'insertForm'); - self::assertEquals( + self::assertSame( 'Abcd', $this->byId('field_2_3')->getAttribute('value'), ); - self::assertEquals( + self::assertSame( '2012-01-20 02:00:02', $this->byId('field_3_3')->getAttribute('value'), ); @@ -242,12 +242,12 @@ class BrowseTest extends TestBase $success = $this->waitForElement('className', 'alert-success'); self::assertStringContainsString('1 row inserted', $success->getText()); - self::assertEquals( + self::assertSame( 'ABCDEFG', $this->getCellByTableClass('table_results', 4, 6), ); - self::assertEquals( + self::assertSame( '2012-01-02 00:00:00', $this->getCellByTableClass('table_results', 4, 7), ); @@ -278,12 +278,12 @@ class BrowseTest extends TestBase $success = $this->waitForElement('className', 'alert-success'); self::assertStringContainsString('Showing rows', $success->getText()); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( '3', $this->getCellByTableClass('table_results', 2, 5), ); diff --git a/tests/end-to-end/Table/CreateTest.php b/tests/end-to-end/Table/CreateTest.php index 6fd197c2e1..38db82ce81 100644 --- a/tests/end-to-end/Table/CreateTest.php +++ b/tests/end-to-end/Table/CreateTest.php @@ -108,31 +108,31 @@ class CreateTest extends TestBase $this->byCssSelector('label[for=checkbox_row_1]')->getText(), ); - self::assertEquals( + self::assertSame( 'int(14)', $this->getCellByTableId('tablestructure', 1, 4), ); - self::assertEquals( + self::assertSame( 'UNSIGNED', $this->getCellByTableId('tablestructure', 1, 6), ); - self::assertEquals( + self::assertSame( 'No', $this->getCellByTableId('tablestructure', 1, 7), ); - self::assertEquals( + self::assertSame( 'None', $this->getCellByTableId('tablestructure', 1, 8), ); - self::assertEquals( + self::assertSame( 'comm1', $this->getCellByTableId('tablestructure', 1, 9), ); - self::assertEquals( + self::assertSame( 'AUTO_INCREMENT', $this->getCellByTableId('tablestructure', 1, 10), ); @@ -148,22 +148,22 @@ class CreateTest extends TestBase $this->byCssSelector('label[for=checkbox_row_2]')->getText(), ); - self::assertEquals( + self::assertSame( 'varchar(10)', $this->getCellByTableId('tablestructure', 2, 4), ); - self::assertEquals( + self::assertSame( 'utf8mb4_general_ci', $this->getCellByTableId('tablestructure', 2, 5), ); - self::assertEquals( + self::assertSame( 'Yes', $this->getCellByTableId('tablestructure', 2, 7), ); - self::assertEquals( + self::assertSame( 'def', $this->getCellByTableId('tablestructure', 2, 8), ); diff --git a/tests/end-to-end/Table/InsertTest.php b/tests/end-to-end/Table/InsertTest.php index 6b6be2cfc4..05564a7a45 100644 --- a/tests/end-to-end/Table/InsertTest.php +++ b/tests/end-to-end/Table/InsertTest.php @@ -107,47 +107,47 @@ class InsertTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( + self::assertSame( '1', $this->getCellByTableClass('table_results', 1, 5), ); - self::assertEquals( + self::assertSame( 'abcd', $this->getCellByTableClass('table_results', 1, 6), ); - self::assertEquals( + self::assertSame( '2011-01-02 00:00:00', $this->getCellByTableClass('table_results', 1, 7), ); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 2, 5), ); - self::assertEquals( + self::assertSame( 'foo', $this->getCellByTableClass('table_results', 2, 6), ); - self::assertEquals( + self::assertSame( '2012-01-02 00:00:00', $this->getCellByTableClass('table_results', 2, 7), ); - self::assertEquals( + self::assertSame( '4', $this->getCellByTableClass('table_results', 3, 5), ); - self::assertEquals( + self::assertSame( 'Abcd', $this->getCellByTableClass('table_results', 3, 6), ); - self::assertEquals( + self::assertSame( '2013-01-02 00:00:00', $this->getCellByTableClass('table_results', 3, 7), ); diff --git a/tests/end-to-end/Table/OperationsTest.php b/tests/end-to-end/Table/OperationsTest.php index d387c04394..007f1c4eed 100644 --- a/tests/end-to-end/Table/OperationsTest.php +++ b/tests/end-to-end/Table/OperationsTest.php @@ -70,7 +70,7 @@ class OperationsTest extends TestBase $this->waitAjax(); $this->waitForElement('cssSelector', 'table.table_results'); - self::assertEquals( + self::assertSame( '2', $this->getCellByTableClass('table_results', 1, 5), ); @@ -99,7 +99,7 @@ class OperationsTest extends TestBase . 'SHOW TABLES LIKE \'test_table2\'', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('test_table2', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_table2', $this->getCellByTableClass('table_results', 1, 1)); }, ); } @@ -127,7 +127,7 @@ class OperationsTest extends TestBase . 'SHOW TABLES LIKE \'test_table2\'', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('test_table2', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_table2', $this->getCellByTableClass('table_results', 1, 1)); }, ); } @@ -155,7 +155,7 @@ class OperationsTest extends TestBase 'SELECT COUNT(*) as c FROM `' . $this->databaseName . '`.test_table2', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('2', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('2', $this->getCellByTableClass('table_results', 1, 1)); }, ); } @@ -178,7 +178,7 @@ class OperationsTest extends TestBase 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->databaseName . '`.test_table', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); }, ); } diff --git a/tests/end-to-end/Table/StructureTest.php b/tests/end-to-end/Table/StructureTest.php index 6ad1ee2cbe..88d9266a3f 100644 --- a/tests/end-to-end/Table/StructureTest.php +++ b/tests/end-to-end/Table/StructureTest.php @@ -57,12 +57,12 @@ class StructureTest extends TestBase $this->waitAjax(); $this->waitForElement('id', 'tablestructure'); - self::assertEquals( + self::assertSame( 'val3', $this->byCssSelector('label[for=checkbox_row_4]')->getText(), ); - self::assertEquals( + self::assertSame( 'int(11)', $this->getCellByTableId('tablestructure', 4, 4), ); @@ -78,7 +78,7 @@ class StructureTest extends TestBase $this->waitUntilElementIsPresent('className', 'append_fields_form', 30); - self::assertEquals('val', $this->byId('field_0_1')->getAttribute('value')); + self::assertSame('val', $this->byId('field_0_1')->getAttribute('value')); $this->byId('field_0_1')->clear(); $this->byId('field_0_1')->sendKeys('val3'); $this->byCssSelector("input[name='do_save_data']")->click(); @@ -88,7 +88,7 @@ class StructureTest extends TestBase $this->waitForElement('id', 'tablestructure'); - self::assertEquals( + self::assertSame( 'val3', $this->waitForElement('cssSelector', 'label[for=checkbox_row_2]')->getText(), ); diff --git a/tests/end-to-end/TriggersTest.php b/tests/end-to-end/TriggersTest.php index 322f64a2e2..51eaebb395 100644 --- a/tests/end-to-end/TriggersTest.php +++ b/tests/end-to-end/TriggersTest.php @@ -107,7 +107,7 @@ class TriggersTest extends TestBase 'SHOW TRIGGERS FROM `' . $this->databaseName . '`;', function (): void { self::assertTrue($this->isElementPresent('className', 'table_results')); - self::assertEquals('test_trigger', $this->getCellByTableClass('table_results', 1, 1)); + self::assertSame('test_trigger', $this->getCellByTableClass('table_results', 1, 1)); }, ); @@ -118,7 +118,7 @@ class TriggersTest extends TestBase function (): void { $this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20); // [ ] | Edit | Copy | Delete | 1 | 3 - self::assertEquals('3', $this->getCellByTableClass('table_results', 1, 6)); + self::assertSame('3', $this->getCellByTableClass('table_results', 1, 6)); }, ); } @@ -154,7 +154,7 @@ class TriggersTest extends TestBase function (): void { $this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20); // [ ] | Edit | Copy | Delete | 1 | 12 - self::assertEquals('12', $this->getCellByTableClass('table_results', 1, 6)); + self::assertSame('12', $this->getCellByTableClass('table_results', 1, 6)); }, ); } @@ -184,7 +184,7 @@ class TriggersTest extends TestBase function (): void { $this->scrollToElement($this->waitForElement('className', 'table_results'), 0, 20); // [ ] | Edit | Copy | Delete | 1 | 2 - self::assertEquals('2', $this->getCellByTableClass('table_results', 1, 6)); + self::assertSame('2', $this->getCellByTableClass('table_results', 1, 6)); }, ); diff --git a/tests/end-to-end/XssTest.php b/tests/end-to-end/XssTest.php index e5ff5437c4..c40b7ef26d 100644 --- a/tests/end-to-end/XssTest.php +++ b/tests/end-to-end/XssTest.php @@ -37,6 +37,6 @@ class XssTest extends TestBase $this->waitForElement('id', 'querybox'); $this->byId('button_submit_query')->click(); - self::assertEquals('Missing value in the form!', $this->alertText()); + self::assertSame('Missing value in the form!', $this->alertText()); } } diff --git a/tests/unit/ConfigTest.php b/tests/unit/ConfigTest.php index 3f102902fd..0bc6ce83ec 100644 --- a/tests/unit/ConfigTest.php +++ b/tests/unit/ConfigTest.php @@ -178,7 +178,7 @@ PHP; return; } - self::assertEquals( + self::assertSame( $version, $this->object->get('PMA_USR_BROWSER_VER'), ); diff --git a/tests/unit/Database/Designer/CommonTest.php b/tests/unit/Database/Designer/CommonTest.php index 9a30f2528f..3e07bbcda5 100644 --- a/tests/unit/Database/Designer/CommonTest.php +++ b/tests/unit/Database/Designer/CommonTest.php @@ -165,7 +165,7 @@ class CommonTest extends AbstractTestCase $this->designerCommon = new Common(DatabaseInterface::getInstance(), new Relation($dbi)); $result = $this->designerCommon->getDefaultPage($db); - self::assertEquals($defaultPg, $result); + self::assertSame((int) $defaultPg, $result); } /** @@ -228,7 +228,7 @@ class CommonTest extends AbstractTestCase $this->designerCommon = new Common(DatabaseInterface::getInstance(), new Relation($dbi)); $result = $this->designerCommon->getLoadingPage($db); - self::assertEquals($defaultPg, $result); + self::assertSame((int) $defaultPg, $result); } /** @@ -251,7 +251,7 @@ class CommonTest extends AbstractTestCase $this->designerCommon = new Common(DatabaseInterface::getInstance(), new Relation($dbi)); $result = $this->designerCommon->getLoadingPage($db); - self::assertEquals($firstPg, $result); + self::assertSame((int) $firstPg, $result); } private function loadTestDataForRelationDeleteAddTests(string $createTableString): void diff --git a/tests/unit/Engines/PbxtTest.php b/tests/unit/Engines/PbxtTest.php index 48d072f68f..2e06b53c3e 100644 --- a/tests/unit/Engines/PbxtTest.php +++ b/tests/unit/Engines/PbxtTest.php @@ -214,7 +214,7 @@ class PbxtTest extends AbstractTestCase . '

' . "\n", ); - self::assertEquals( + self::assertSame( $this->object->getPage('NonExistMethod'), '', ); diff --git a/tests/unit/I18n/LanguageManagerTest.php b/tests/unit/I18n/LanguageManagerTest.php index 185b0ab7f5..9c43c905f1 100644 --- a/tests/unit/I18n/LanguageManagerTest.php +++ b/tests/unit/I18n/LanguageManagerTest.php @@ -103,7 +103,7 @@ final class LanguageManagerTest extends AbstractTestCase /* Ensure we have name for every language */ foreach ($langs as $lang) { - self::assertNotEquals( + self::assertNotSame( $lang->getCode(), strtolower($lang->getEnglishName()), 'Maybe this language does not exist in LanguageManager class' diff --git a/tests/unit/IndexTest.php b/tests/unit/IndexTest.php index b2d22ac0d8..9ee60df571 100644 --- a/tests/unit/IndexTest.php +++ b/tests/unit/IndexTest.php @@ -78,8 +78,7 @@ class IndexTest extends AbstractTestCase 'PMA_Packed', $index->getPacked(), ); - self::assertEquals( - 'PMA_Non_unique', + self::assertTrue( $index->getNonUnique(), ); self::assertStringContainsString( @@ -152,16 +151,16 @@ class IndexTest extends AbstractTestCase 'column1', $indexColumn->getName(), ); - self::assertEquals( - '1', + self::assertSame( + 1, $indexColumn->getSeqInIndex(), ); self::assertSame( 'Collation1', $indexColumn->getCollation(), ); - self::assertEquals( - '1', + self::assertSame( + 1, $indexColumn->getCardinality(), ); } diff --git a/tests/unit/InsertEditTest.php b/tests/unit/InsertEditTest.php index ca7953deb6..32ad3cfbd2 100644 --- a/tests/unit/InsertEditTest.php +++ b/tests/unit/InsertEditTest.php @@ -1528,7 +1528,7 @@ class InsertEditTest extends AbstractTestCase $result = $this->insertEdit->getDisplayValueForForeignTableColumn('=1', $map, 'f'); - self::assertEquals(2, $result); + self::assertSame('2', $result); } /** diff --git a/tests/unit/Plugins/Auth/AuthenticationHttpTest.php b/tests/unit/Plugins/Auth/AuthenticationHttpTest.php index 47f4eb5bf9..5044ceda3e 100644 --- a/tests/unit/Plugins/Auth/AuthenticationHttpTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationHttpTest.php @@ -125,7 +125,7 @@ class AuthenticationHttpTest extends AbstractTestCase * @param string $passIndex index to test username against * @param string|bool $expectedReturn expected return value from test * @param string $expectedUser expected username to be set - * @param string|bool $expectedPass expected password to be set + * @param string $expectedPass expected password to be set * @param string|bool $oldUsr value for $_REQUEST['old_usr'] */ #[DataProvider('readCredentialsProvider')] @@ -136,7 +136,7 @@ class AuthenticationHttpTest extends AbstractTestCase string $passIndex, string|bool $expectedReturn, string $expectedUser, - string|bool $expectedPass, + string $expectedPass, string|bool $oldUsr = '', ): void { $_SERVER[$userIndex] = $user; @@ -151,7 +151,7 @@ class AuthenticationHttpTest extends AbstractTestCase self::assertSame($expectedUser, $this->object->user); - self::assertEquals($expectedPass, $this->object->password); + self::assertSame($expectedPass, $this->object->password); unset($_SERVER[$userIndex]); unset($_SERVER[$passIndex]); @@ -175,7 +175,7 @@ class AuthenticationHttpTest extends AbstractTestCase 'Basic Zm9vYmFy', 'pswd', ], - ['Basic ' . base64_encode('foobar:'), 'pswd', 'AUTH_USER', 'AUTH_PASSWORD', true, 'foobar', false], + ['Basic ' . base64_encode('foobar:'), 'pswd', 'AUTH_USER', 'AUTH_PASSWORD', true, 'foobar', ''], [ 'Basic ' . base64_encode(':foobar'), 'pswd', diff --git a/tests/unit/Plugins/Export/ExportSqlTest.php b/tests/unit/Plugins/Export/ExportSqlTest.php index ca58e9dfd2..f3c1db2656 100644 --- a/tests/unit/Plugins/Export/ExportSqlTest.php +++ b/tests/unit/Plugins/Export/ExportSqlTest.php @@ -963,7 +963,7 @@ SQL; $sqlViews = (new ReflectionProperty(ExportSql::class, 'sqlViews'))->getValue($this->object); - self::assertEquals('', $result); + self::assertSame('', $result); self::assertIsString($sqlViews); self::assertStringContainsString('-- Structure for view test_table', $sqlViews); self::assertStringContainsString('DROP TABLE IF EXISTS `test_table`;', $sqlViews); diff --git a/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php b/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php index 96f0d7dda4..6bc2f7fcb6 100644 --- a/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php +++ b/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php @@ -41,7 +41,7 @@ class TablePropertyTest extends AbstractTestCase self::assertSame('int', $this->object->type); - self::assertEquals('YES', $this->object->nullable); + self::assertSame('YES', $this->object->nullable); self::assertSame('PRI', $this->object->key); diff --git a/tests/unit/Plugins/Transformations/TransformationPluginsTest.php b/tests/unit/Plugins/Transformations/TransformationPluginsTest.php index 8735779359..5408f2aa35 100644 --- a/tests/unit/Plugins/Transformations/TransformationPluginsTest.php +++ b/tests/unit/Plugins/Transformations/TransformationPluginsTest.php @@ -411,7 +411,7 @@ class TransformationPluginsTest extends AbstractTestCase public function testGetMulti(object $object, string $method, mixed $expected, array $args = []): void { $reflectionMethod = new ReflectionMethod($object, $method); - self::assertEquals( + self::assertSame( $expected, $reflectionMethod->invokeArgs($object, $args), ); @@ -660,7 +660,7 @@ class TransformationPluginsTest extends AbstractTestCase string $error = '', ): void { $actual = $object->applyTransformation(...$applyArgs); - self::assertEquals($transformed, $actual); + self::assertSame($transformed, $actual); if (! ($object instanceof IOTransformationsPlugin)) { return; diff --git a/tests/unit/TwoFactorTest.php b/tests/unit/TwoFactorTest.php index 543b74231e..3ccaddedeb 100644 --- a/tests/unit/TwoFactorTest.php +++ b/tests/unit/TwoFactorTest.php @@ -217,7 +217,7 @@ class TwoFactorTest extends AbstractTestCase $request = $serverRequestFactory->createServerRequest('POST', 'https://example.com/'); /* Test rendering */ - self::assertNotEquals('', $object->render($request)); + self::assertNotSame('', $object->render($request)); self::assertSame('', $object->setup($request)); } @@ -316,8 +316,8 @@ class TwoFactorTest extends AbstractTestCase unset($_POST['2fa_code']); /* Test rendering */ - self::assertNotEquals('', $object->render($request)); - self::assertNotEquals('', $object->setup($request)); + self::assertNotSame('', $object->render($request)); + self::assertNotSame('', $object->setup($request)); } public function testKey(): void @@ -357,8 +357,8 @@ class TwoFactorTest extends AbstractTestCase self::assertFalse($object->check($request, true)); /* Test rendering */ - self::assertNotEquals('', $object->render($request)); - self::assertNotEquals('', $object->setup($request)); + self::assertNotSame('', $object->render($request)); + self::assertNotSame('', $object->setup($request)); } /** diff --git a/tests/unit/TypesTest.php b/tests/unit/TypesTest.php index 0104fc84e9..44d3cf3fb0 100644 --- a/tests/unit/TypesTest.php +++ b/tests/unit/TypesTest.php @@ -265,7 +265,7 @@ class TypesTest extends AbstractTestCase #[DataProvider('providerForTestGetTypeDescription')] public function testGetTypeDescription(string $type): void { - self::assertNotEquals( + self::assertNotSame( '', $this->object->getTypeDescription($type), ); diff --git a/tests/unit/UtilTest.php b/tests/unit/UtilTest.php index e8fd9dcad8..2ec0902f8a 100644 --- a/tests/unit/UtilTest.php +++ b/tests/unit/UtilTest.php @@ -916,11 +916,11 @@ class UtilTest extends AbstractTestCase } #[DataProvider('providerForTestBackquote')] - public function testBackquote(string|null $entry, string $expectedNoneOutput, string $expectedMssqlOutput): void + public function testBackquote(string $entry, string $expectedNoneOutput, string $expectedMssqlOutput): void { self::assertSame($expectedNoneOutput, Util::backquote($entry)); - self::assertEquals($entry, Util::backquoteCompat($entry, 'NONE', false)); - self::assertEquals($entry, Util::backquoteCompat($entry, 'MSSQL', false)); + self::assertSame($entry, Util::backquoteCompat($entry, 'NONE', false)); + self::assertSame($entry, Util::backquoteCompat($entry, 'MSSQL', false)); self::assertSame($expectedNoneOutput, Util::backquoteCompat($entry, 'NONE')); self::assertSame($expectedMssqlOutput, Util::backquoteCompat($entry, 'MSSQL')); } @@ -935,7 +935,6 @@ class UtilTest extends AbstractTestCase ['te"st', '`te"st`', '"te\"st"'], ['', '', ''], ['*', '*', '*'], - [null, '', ''], ]; } diff --git a/tests/unit/Utils/FormatConverterTest.php b/tests/unit/Utils/FormatConverterTest.php index a2df1432bf..a7459a75a6 100644 --- a/tests/unit/Utils/FormatConverterTest.php +++ b/tests/unit/Utils/FormatConverterTest.php @@ -80,10 +80,10 @@ class FormatConverterTest extends AbstractTestCase * @param string $input Input to convert */ #[DataProvider('providerIpToLong')] - public function testIpToLong(string $expected, string $input): void + public function testIpToLong(string|int $expected, string $input): void { $result = FormatConverter::ipToLong($input); - self::assertEquals($expected, $result); + self::assertSame($expected, $result); } /** @@ -93,7 +93,7 @@ class FormatConverterTest extends AbstractTestCase */ public static function providerIpToLong(): array { - return [['168496141', '10.11.12.13'], ['my ip', 'my ip']]; + return [[168496141, '10.11.12.13'], ['my ip', 'my ip']]; } /**