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()