diff --git a/tests/Testing/Concerns/InteractsWithDatabaseTest.php b/tests/Testing/Concerns/InteractsWithDatabaseTest.php index 497653645292..9b9168930c61 100644 --- a/tests/Testing/Concerns/InteractsWithDatabaseTest.php +++ b/tests/Testing/Concerns/InteractsWithDatabaseTest.php @@ -149,15 +149,15 @@ protected function castAsJson($value, $grammar) $connection->shouldReceive('getQueryGrammar')->andReturn($grammar); + $connection->shouldReceive('raw')->andReturnUsing(function ($value) { + return new Expression($value); + }); + $connection->shouldReceive('getPdo->quote')->andReturnUsing(function ($value) { return "'".$value."'"; }); - DB::shouldReceive('connection')->andReturn($connection); - - DB::shouldReceive('raw')->andReturnUsing(function ($value) { - return new Expression($value); - }); + DB::shouldReceive('connection')->with(null)->andReturn($connection); $instance = new class {