From 86a170936e8ab384c405275f672529174ff793b0 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Thu, 17 Jun 2021 18:36:46 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Update=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/BuilderTest.php | 12 ++++++------ tests/ModelTest.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/BuilderTest.php b/tests/BuilderTest.php index c771904..3b981a3 100644 --- a/tests/BuilderTest.php +++ b/tests/BuilderTest.php @@ -44,7 +44,7 @@ public function it_should_generate_where_equals_query_with_operator(): void $this->igdb->where('name', '=', 'Fortnite')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite";'); }); $this->igdb->where('first_release_date', '>=', 1546297200)->get(); @@ -60,7 +60,7 @@ public function it_should_generate_where_equals_query_without_operator(): void $this->igdb->where('name', 'Fortnite')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite";'); }); } @@ -70,7 +70,7 @@ public function it_should_generate_and_where_query(): void $this->igdb->where('name', 'Fortnite')->where('name', 'Borderlands 2')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite & name = Borderlands 2;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" & name = "Borderlands 2";'); }); } @@ -80,7 +80,7 @@ public function it_should_generate_or_where_query(): void $this->igdb->where('name', 'Fortnite')->orWhere('name', 'Borderlands 2')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite | name = Borderlands 2;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" | name = "Borderlands 2";'); }); } @@ -346,7 +346,7 @@ public function it_should_generate_nested_where_query(): void })->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite | (aggregated_rating >= 90 & aggregated_rating_count >= 3000);'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" | (aggregated_rating >= 90 & aggregated_rating_count >= 3000);'); }); } @@ -356,7 +356,7 @@ public function it_should_generate_array_where_query(): void $this->igdb->where([['name', 'Fortnite'], ['name', 'Borderlands 2']])->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where (name = Fortnite & name = Borderlands 2);'); + return $this->isApiCall($request, 'games', 'where (name = "Fortnite" & name = "Borderlands 2");'); }); } diff --git a/tests/ModelTest.php b/tests/ModelTest.php index 0cfaad3..8f27474 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -35,7 +35,7 @@ public function it_should_generate_where_equals_query_with_operator(): void Game::where('name', '=', 'Fortnite')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite";'); }); Game::where('first_release_date', '>=', 1546297200)->get(); @@ -51,7 +51,7 @@ public function it_should_generate_where_equals_query_without_operator(): void Game::where('name', 'Fortnite')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite";'); }); } @@ -61,7 +61,7 @@ public function it_should_generate_and_where_query(): void Game::where('name', 'Fortnite')->where('name', 'Borderlands 2')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite & name = Borderlands 2;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" & name = "Borderlands 2";'); }); } @@ -71,7 +71,7 @@ public function it_should_generate_or_where_query(): void Game::where('name', 'Fortnite')->orWhere('name', 'Borderlands 2')->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite | name = Borderlands 2;'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" | name = "Borderlands 2";'); }); } @@ -337,7 +337,7 @@ public function it_should_generate_nested_where_query(): void })->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where name = Fortnite | (aggregated_rating >= 90 & aggregated_rating_count >= 3000);'); + return $this->isApiCall($request, 'games', 'where name = "Fortnite" | (aggregated_rating >= 90 & aggregated_rating_count >= 3000);'); }); } @@ -347,7 +347,7 @@ public function it_should_generate_array_where_query(): void Game::where([['name', 'Fortnite'], ['name', 'Borderlands 2']])->get(); Http::assertSent(function (Request $request) { - return $this->isApiCall($request, 'games', 'where (name = Fortnite & name = Borderlands 2);'); + return $this->isApiCall($request, 'games', 'where (name = "Fortnite" & name = "Borderlands 2");'); }); }