mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
added tests for top/reviews endpoint
This commit is contained in:
parent
6e4ff113e3
commit
a9f02dad8b
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user