mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add/update tests #50
This commit is contained in:
parent
ca8d8d14f0
commit
643c57efb1
33
tests/Http/Controllers/SearchControllerTest.php
Normal file
33
tests/Http/Controllers/SearchControllerTest.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class SearchControllerTest extends TestCase
|
||||
{
|
||||
public function testSearch()
|
||||
{
|
||||
$this->get('/v3/search/anime?order_by=9&sort=asc')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'results' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'title',
|
||||
'airing',
|
||||
'synopsis',
|
||||
'type',
|
||||
'episodes',
|
||||
'score',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'members',
|
||||
'rated'
|
||||
]
|
||||
]
|
||||
])
|
||||
->seeJson([
|
||||
'request_cached' => true
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
49
tests/Http/Controllers/SeasonControllerTest.php
Normal file
49
tests/Http/Controllers/SeasonControllerTest.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
class SeasonControllerTest extends TestCase
|
||||
{
|
||||
public function testSchedule()
|
||||
{
|
||||
$this->get('/v3/season')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'season_name',
|
||||
'season_year',
|
||||
'anime' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'image_url',
|
||||
'synopsis',
|
||||
'type',
|
||||
'airing_start',
|
||||
'episodes',
|
||||
'members',
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'source',
|
||||
'producers' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'score',
|
||||
'licensors',
|
||||
'r18',
|
||||
'kids',
|
||||
'continuing'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
@ -69,7 +69,7 @@ class TopControllerTest extends TestCase
|
||||
|
||||
public function testTopCharacters()
|
||||
{
|
||||
$this->get('/v3/top/people')
|
||||
$this->get('/v3/top/characters')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'top' => [
|
||||
@ -79,8 +79,7 @@ class TopControllerTest extends TestCase
|
||||
'title', // todo should be `name`
|
||||
'url',
|
||||
'name_kanji',
|
||||
'favorites',
|
||||
'image_url',
|
||||
|
||||
'animeography' => [
|
||||
[
|
||||
'mal_id',
|
||||
@ -97,6 +96,8 @@ class TopControllerTest extends TestCase
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'favorites',
|
||||
'image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user