Use strict assertions
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
17de1bdf93
commit
ee57b0c72f
@ -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()),
|
||||
);
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
|
||||
@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
@ -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),
|
||||
);
|
||||
|
||||
@ -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),
|
||||
);
|
||||
|
||||
@ -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),
|
||||
);
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
|
||||
@ -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));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ PHP;
|
||||
return;
|
||||
}
|
||||
|
||||
self::assertEquals(
|
||||
self::assertSame(
|
||||
$version,
|
||||
$this->object->get('PMA_USR_BROWSER_VER'),
|
||||
);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -214,7 +214,7 @@ class PbxtTest extends AbstractTestCase
|
||||
. '</p>' . "\n",
|
||||
);
|
||||
|
||||
self::assertEquals(
|
||||
self::assertSame(
|
||||
$this->object->getPage('NonExistMethod'),
|
||||
'',
|
||||
);
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -1528,7 +1528,7 @@ class InsertEditTest extends AbstractTestCase
|
||||
|
||||
$result = $this->insertEdit->getDisplayValueForForeignTableColumn('=1', $map, 'f');
|
||||
|
||||
self::assertEquals(2, $result);
|
||||
self::assertSame('2', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -265,7 +265,7 @@ class TypesTest extends AbstractTestCase
|
||||
#[DataProvider('providerForTestGetTypeDescription')]
|
||||
public function testGetTypeDescription(string $type): void
|
||||
{
|
||||
self::assertNotEquals(
|
||||
self::assertNotSame(
|
||||
'',
|
||||
$this->object->getTypeDescription($type),
|
||||
);
|
||||
|
||||
@ -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, '', ''],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -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']];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user