diff --git a/src/db/test/unit/Eloquent/ModelTest.php b/src/db/test/unit/Eloquent/ModelTest.php index 9c8dafa78..9754af795 100644 --- a/src/db/test/unit/Eloquent/ModelTest.php +++ b/src/db/test/unit/Eloquent/ModelTest.php @@ -780,14 +780,14 @@ public function testProp() $expectSql = '`user_desc` = ?'; $sql = User::whereProp('udesc', $desc)->toSql(); - $this->assertContains($expectSql, $sql); + $this->assertStringContainsString($expectSql, $sql); $expectSql1 = 'select * from `user` where (`user_desc` = ? and `test_json`->\'$."user_status"\' = ?)'; $sql1 = User::whereProp([ 'udesc' => $desc, 'test_json->user_status' => $rand ])->toSql(); - $this->assertContains($expectSql1, $sql1); + $this->assertStringContainsString($expectSql1, $sql1); } public function testUpdateOrCreate() diff --git a/src/http-server/test/unit/Router/RouterTest.php b/src/http-server/test/unit/Router/RouterTest.php index e11aa3366..c234a5927 100644 --- a/src/http-server/test/unit/Router/RouterTest.php +++ b/src/http-server/test/unit/Router/RouterTest.php @@ -57,7 +57,7 @@ public function testAddRoutes(): void $this->assertContains('name', $r1->getPathVars()); $this->assertContains('age', $r1->getPathVars()); $this->assertArrayHasKey('age', $r1->getBindVars()); - $this->assertContains('GET /my[/{name}[/{age}]]', (string)$r1); + $this->assertStringContainsString('GET /my[/{name}[/{age}]]', (string)$r1); foreach (Router::METHODS_ARRAY as $method) { $r->$method("/$method", "handle_$method"); @@ -66,14 +66,14 @@ public function testAddRoutes(): void $string = (string)$r; foreach (Router::METHODS_ARRAY as $method) { $s = sprintf('%-7s %-25s --> %s', $method, "/$method", "handle_$method"); - $this->assertContains($s, $string); + $this->assertStringContainsString($s, $string); } $r->add('ANY', '/any', 'handler_any'); $string = $r->toString(); foreach (Router::METHODS_ARRAY as $method) { $s = sprintf('%-7s %-25s --> %s', $method, '/any', 'handler_any'); - $this->assertContains($s, $string); + $this->assertStringContainsString($s, $string); } $this->expectExceptionMessage('The method and route handler is not allow empty.'); @@ -82,7 +82,7 @@ public function testAddRoutes(): void try { $r->add('invalid', '/path', '/handler'); } catch (Throwable $e) { - $this->assertContains('The method [INVALID] is not supported', $e->getMessage()); + $this->assertStringContainsString('The method [INVALID] is not supported', $e->getMessage()); } } diff --git a/src/rpc-server/test/testing/Concern/RpcResponseAssertTrait.php b/src/rpc-server/test/testing/Concern/RpcResponseAssertTrait.php index c6585c9a3..e62024aef 100644 --- a/src/rpc-server/test/testing/Concern/RpcResponseAssertTrait.php +++ b/src/rpc-server/test/testing/Concern/RpcResponseAssertTrait.php @@ -69,7 +69,7 @@ public function assertErrorMessage(string $message): void } $errorMessage = $error->getMessage(); - Assert::assertContains($message, $errorMessage); + Assert::assertStringContainsString($message, $errorMessage); } /**