diff --git a/tests/Integration/TopControllerTest.php b/tests/Integration/TopControllerTest.php index e85ca9f..f445066 100644 --- a/tests/Integration/TopControllerTest.php +++ b/tests/Integration/TopControllerTest.php @@ -14,6 +14,15 @@ class TopControllerTest extends TestCase use SyntheticMongoDbTransaction; use ScoutFlush; + public function topReviewTypeParametersProvider(): array + { + return [ + "empty query string" => [[]], + "query string = `?type=anime`" => [["type" => "anime"]], + "query string = `?type=manga`" => [["type" => "manga"]], + ]; + } + public function testTopAnime() { Anime::factory(3)->state(new Sequence( @@ -290,4 +299,15 @@ class TopControllerTest extends TestCase $this->get('/v4/top/anime/999') ->seeStatusCode(404); } + + /** + * @dataProvider topReviewTypeParametersProvider + * @param $params + * @return void + */ + public function testTopReviews($params) + { + $this->getJsonResponse($params,"/v4/top/reviews"); + $this->seeStatusCode(200); + } }