Use ::class instead of ::className() in tests. (#20612)

This commit is contained in:
Wilmer Arambula
2025-10-14 13:26:35 -03:00
committed by GitHub
parent 4c3deb055b
commit c960f93dfe
89 changed files with 528 additions and 528 deletions

View File

@@ -211,7 +211,7 @@ abstract class SchemaTest extends DatabaseTestCase
$schema->db->tablePrefix = $tablePrefix;
$schema->db->schemaCache = new ArrayCache();
$noCacheTable = $schema->getTableSchema($tableName, true);
$this->assertInstanceOf(TableSchema::className(), $noCacheTable);
$this->assertInstanceOf(TableSchema::class, $noCacheTable);
// Compare
$schema->db->tablePrefix = $testTablePrefix;
@@ -221,14 +221,14 @@ abstract class SchemaTest extends DatabaseTestCase
$schema->db->tablePrefix = $tablePrefix;
$schema->refreshTableSchema($tableName);
$refreshedTable = $schema->getTableSchema($tableName, false);
$this->assertInstanceOf(TableSchema::className(), $refreshedTable);
$this->assertInstanceOf(TableSchema::class, $refreshedTable);
$this->assertNotSame($noCacheTable, $refreshedTable);
// Compare
$schema->db->tablePrefix = $testTablePrefix;
$schema->refreshTableSchema($testTablePrefix);
$testRefreshedTable = $schema->getTableSchema($testTableName, false);
$this->assertInstanceOf(TableSchema::className(), $testRefreshedTable);
$this->assertInstanceOf(TableSchema::class, $testRefreshedTable);
$this->assertEquals($refreshedTable, $testRefreshedTable);
$this->assertNotSame($testNoCacheTable, $testRefreshedTable);
}
@@ -884,7 +884,7 @@ abstract class SchemaTest extends DatabaseTestCase
protected function normalizeConstraintPair(Constraint $expectedConstraint, Constraint $actualConstraint)
{
if ($expectedConstraint::className() !== $actualConstraint::className()) {
if (get_class($expectedConstraint) !== get_class($actualConstraint)) {
return;
}