From 5ef9184cbf625a1d752ef120a429759c8a43c84a Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Wed, 27 Sep 2023 07:58:57 -0300 Subject: [PATCH] Fix minor corrections. --- tests/CommandTest.php | 2 +- tests/console/controllers/MigrateControllerTest.php | 6 +++--- tests/rbac/MongoDbManagerTest.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/CommandTest.php b/tests/CommandTest.php index 3706b5748..101c84e95 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -343,7 +343,7 @@ public function testListCollections() $collections = $connection->createCommand()->listCollections(); $collectionNames = ArrayHelper::getColumn($collections, 'name'); - $this->assertStringContainsString('customer', $collectionNames); + $this->assertContains('customer', $collectionNames); } /** diff --git a/tests/console/controllers/MigrateControllerTest.php b/tests/console/controllers/MigrateControllerTest.php index 9466abb05..f8e0b5c07 100644 --- a/tests/console/controllers/MigrateControllerTest.php +++ b/tests/console/controllers/MigrateControllerTest.php @@ -368,7 +368,7 @@ public function testNamespaceCreate() $files = FileHelper::findFiles($this->migrationPath); $fileContent = file_get_contents($files[0]); $this->assertStringContainsString("namespace {$this->migrationNamespace};", $fileContent); - $this->assertRegExp('/class M[0-9]{12}' . ucfirst($migrationName) . '/s', $fileContent); + $this->assertMatchesRegularExpression('/class M[0-9]{12}' . ucfirst($migrationName) . '/s', $fileContent); unlink($files[0]); // namespace specify : @@ -454,8 +454,8 @@ public function testNamespaceHistory() $this->runMigrateControllerAction('up', [], $controllerConfig); $output = $this->runMigrateControllerAction('history', [], $controllerConfig); - $this->assertRegExp('/' . preg_quote($this->migrationNamespace) . '.*History1/s', $output); - $this->assertRegExp('/' . preg_quote($this->migrationNamespace) . '.*History2/s', $output); + $this->assertMatchesRegularExpression('/' . preg_quote($this->migrationNamespace) . '.*History1/s', $output); + $this->assertMatchesRegularExpression('/' . preg_quote($this->migrationNamespace) . '.*History2/s', $output); } /** diff --git a/tests/rbac/MongoDbManagerTest.php b/tests/rbac/MongoDbManagerTest.php index c3b497456..f9ce2fc61 100644 --- a/tests/rbac/MongoDbManagerTest.php +++ b/tests/rbac/MongoDbManagerTest.php @@ -160,8 +160,8 @@ public function testGetRules() $ruleNames[] = $rule->name; } - $this->assertStringContainsString('isReallyReallyAuthor', $ruleNames); - $this->assertStringContainsString('isAuthor', $ruleNames); + $this->assertContains('isReallyReallyAuthor', $ruleNames); + $this->assertContains('isAuthor', $ruleNames); } public function testRemoveRule() @@ -362,8 +362,8 @@ public function testAssignMultipleRoles() $roleNames[] = $role->name; } - $this->assertStringContainsString('reader', $roleNames, 'Roles should contain reader. Currently it has: ' . implode(', ', $roleNames)); - $this->assertStringContainsString('author', $roleNames, 'Roles should contain author. Currently it has: ' . implode(', ', $roleNames)); + $this->assertContains('reader', $roleNames, 'Roles should contain reader. Currently it has: ' . implode(', ', $roleNames)); + $this->assertContains('author', $roleNames, 'Roles should contain author. Currently it has: ' . implode(', ', $roleNames)); } public function testAssignmentsToIntegerId()