Skip to content

Commit 9e4af1b

Browse files
Merge pull request #18641 from kamil-tekiela/assertFalse
Use assertFalse and assertTrue
2 parents 9266df0 + c95619c commit 9e4af1b

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

psalm-baseline.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14618,6 +14618,14 @@
1461814618
<code>$result</code>
1461914619
</MixedAssignment>
1462014620
</file>
14621+
<file src="test/classes/Plugins/Export/ExportCsvTest.php">
14622+
<RedundantCondition>
14623+
<code>assertFalse</code>
14624+
</RedundantCondition>
14625+
<RedundantConditionGivenDocblockType>
14626+
<code>assertFalse</code>
14627+
</RedundantConditionGivenDocblockType>
14628+
</file>
1462114629
<file src="test/classes/Plugins/Export/ExportHtmlwordTest.php">
1462214630
<MixedArgument>
1462314631
<code>$result</code>

test/classes/Plugins/Export/ExportCsvTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function testExportHeader(): void
251251

252252
$this->assertEquals('"', $GLOBALS['csv_escaped']);
253253

254-
$this->assertEquals(true, $GLOBALS['csv_columns']);
254+
$this->assertTrue($GLOBALS['csv_columns']);
255255

256256
// case 2
257257

@@ -271,7 +271,7 @@ public function testExportHeader(): void
271271

272272
$this->assertEquals('"', $GLOBALS['csv_escaped']);
273273

274-
$this->assertEquals(false, $GLOBALS['csv_columns']);
274+
$this->assertFalse($GLOBALS['csv_columns']);
275275

276276
// case 3
277277

@@ -289,7 +289,7 @@ public function testExportHeader(): void
289289

290290
$this->assertEquals('"', $GLOBALS['csv_escaped']);
291291

292-
$this->assertEquals(false, $GLOBALS['csv_columns']);
292+
$this->assertFalse($GLOBALS['csv_columns']);
293293

294294
// case 4
295295

test/classes/Plugins/Import/ImportCsvTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function testDoImportNormal(): void
267267
$GLOBALS['sql_query'],
268268
);
269269

270-
$this->assertEquals(true, $GLOBALS['finished']);
270+
$this->assertTrue($GLOBALS['finished']);
271271
$this->dummyDbi->assertAllQueriesConsumed();
272272
}
273273

@@ -312,7 +312,7 @@ public function testDoImportSkipHeaders(): void
312312
$GLOBALS['sql_query'],
313313
);
314314

315-
$this->assertEquals(true, $GLOBALS['finished']);
315+
$this->assertTrue($GLOBALS['finished']);
316316
$this->dummyDbi->assertAllQueriesConsumed();
317317
}
318318
}

test/classes/Server/PrivilegesTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ public function testGetDataForDBInfo(): void
8686
[, , $dbname, $tablename, $routinename, $dbnameIsWildcard] = $serverPrivileges->getDataForDBInfo();
8787
$this->assertEquals('PMA\_pred\_dbname', $dbname);
8888
$this->assertEquals('PMA_pred__tablename', $tablename);
89-
$this->assertEquals(false, $dbnameIsWildcard);
89+
$this->assertFalse($dbnameIsWildcard);
9090

9191
// Multiselect database - pred
9292
unset($_POST['pred_tablename'], $_REQUEST['tablename'], $_REQUEST['dbname']);
9393
$_POST['pred_dbname'] = ['PMA\_pred\_dbname', 'PMADbname2'];
9494
[, , $dbname, $tablename, , $dbnameIsWildcard] = $serverPrivileges->getDataForDBInfo();
9595
$this->assertEquals(['PMA\_pred\_dbname', 'PMADbname2'], $dbname);
9696
$this->assertEquals(null, $tablename);
97-
$this->assertEquals(false, $dbnameIsWildcard);
97+
$this->assertFalse($dbnameIsWildcard);
9898

9999
// Multiselect database
100100
unset($_POST['pred_tablename'], $_REQUEST['tablename'], $_POST['pred_dbname']);
101101
$_REQUEST['dbname'] = ['PMA\_dbname', 'PMADbname2'];
102102
[, , $dbname, $tablename, , $dbnameIsWildcard] = $serverPrivileges->getDataForDBInfo();
103103
$this->assertEquals(['PMA\_dbname', 'PMADbname2'], $dbname);
104104
$this->assertEquals(null, $tablename);
105-
$this->assertEquals(false, $dbnameIsWildcard);
105+
$this->assertFalse($dbnameIsWildcard);
106106
}
107107

108108
public function testWildcardEscapeForGrant(): void

test/classes/TableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ public function testMoveCopy(): void
14401440

14411441
$GLOBALS['sql_query'] = '';
14421442
$return = Table::moveCopy('aa', 'ad', 'bb', 'ad', 'structure', true, 'db_copy', true);
1443-
$this->assertEquals(true, $return);
1443+
$this->assertTrue($return);
14441444
$this->assertStringContainsString('DROP TABLE IF EXISTS `bb`.`ad`;', $GLOBALS['sql_query']);
14451445
$this->assertStringContainsString(
14461446
'CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`' .

0 commit comments

Comments
 (0)