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

@@ -61,7 +61,7 @@ class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
$db = $this->prepareMasterSlave($masterCount, $slaveCount);
$this->assertInstanceOf(Connection::className(), $db->getSlave());
$this->assertInstanceOf(Connection::class, $db->getSlave());
$this->assertTrue($db->getSlave()->isActive);
$this->assertFalse($db->isActive);
@@ -73,7 +73,7 @@ class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
$db->createCommand("UPDATE profile SET description='test' WHERE id=1")->execute();
$this->assertTrue($db->isActive);
if ($masterCount > 0) {
$this->assertInstanceOf(Connection::className(), $db->getMaster());
$this->assertInstanceOf(Connection::class, $db->getMaster());
$this->assertTrue($db->getMaster()->isActive);
} else {
$this->assertNull($db->getMaster());
@@ -89,7 +89,7 @@ class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
$this->assertFalse($db->isActive);
$customer = Customer::findOne(1);
$this->assertInstanceOf(Customer::className(), $customer);
$this->assertInstanceOf(Customer::class, $customer);
$this->assertEquals('user1', $customer->name);
$this->assertFalse($db->isActive);
@@ -97,7 +97,7 @@ class ConnectionTest extends \yiiunit\framework\db\ConnectionTest
$customer->save();
$this->assertTrue($db->isActive);
$customer = Customer::findOne(1);
$this->assertInstanceOf(Customer::className(), $customer);
$this->assertInstanceOf(Customer::class, $customer);
$this->assertEquals('user1', $customer->name);
$result = $db->useMaster(function () {
return Customer::findOne(1)->name;