add/update tests #50

This commit is contained in:
Irfan 2019-05-15 12:35:55 +05:00
parent ca8d8d14f0
commit 643c57efb1
3 changed files with 86 additions and 3 deletions

View 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
])
;
}
}

View 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'
]
]
]);
}
}

View File

@ -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',
]
]
]);