mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add v4 tests wip
This commit is contained in:
parent
c713d2097c
commit
74906bd46a
@ -20,6 +20,7 @@ use Jenssegers\Mongodb\MongodbServiceProvider;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use MongoDB\Client;
|
||||
use MongoDB\Collection;
|
||||
use r\Queries\Control\Http;
|
||||
|
||||
class DatabaseResolver
|
||||
{
|
||||
@ -118,6 +119,8 @@ class DatabaseResolver
|
||||
$this->insertCache($response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( $this->queueable && $expiresAt < time()) {
|
||||
$queueHighPriority = \in_array($this->route, self::HIGH_PRIORITY_QUEUE);
|
||||
|
||||
|
@ -117,7 +117,7 @@ if (env('SOURCE_BAD_HEALTH_FAILOVER') && env('DB_CACHING')) {
|
||||
/**
|
||||
* Load Blacklist into Redis
|
||||
*/
|
||||
//\App\Http\Middleware\Blacklist::loadList(); causing issues on high load todo: add it as a one time init
|
||||
//\App\HttpV3\Middleware\Blacklist::loadList(); causing issues on high load todo: add it as a one time init
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
10
composer.lock
generated
10
composer.lock
generated
@ -2210,16 +2210,16 @@
|
||||
},
|
||||
{
|
||||
"name": "jikan-me/jikan",
|
||||
"version": "v3.0.0-alpha.5",
|
||||
"version": "v3.0.0-alpha.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jikan-me/jikan.git",
|
||||
"reference": "e1d11d663669a6e6e5d7ac536138834846764596"
|
||||
"reference": "0c9075c63711ae61239ae987b1f94f7d510591f5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jikan-me/jikan/zipball/e1d11d663669a6e6e5d7ac536138834846764596",
|
||||
"reference": "e1d11d663669a6e6e5d7ac536138834846764596",
|
||||
"url": "https://api.github.com/repos/jikan-me/jikan/zipball/0c9075c63711ae61239ae987b1f94f7d510591f5",
|
||||
"reference": "0c9075c63711ae61239ae987b1f94f7d510591f5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2256,7 +2256,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Jikan is an unofficial MyAnimeList API",
|
||||
"time": "2020-05-26T18:52:10+00:00"
|
||||
"time": "2020-05-29T08:55:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jms/metadata",
|
||||
|
@ -63,7 +63,7 @@ $router->group(
|
||||
'uses' => 'AnimeController@news'
|
||||
]);
|
||||
|
||||
$router->get('/topics', [
|
||||
$router->get('/forum', [
|
||||
'uses' => 'AnimeController@forum'
|
||||
]);
|
||||
|
||||
@ -114,7 +114,7 @@ $router->group(
|
||||
'uses' => 'MangaController@news'
|
||||
]);
|
||||
|
||||
$router->get('/topics', [
|
||||
$router->get('/forum', [
|
||||
'uses' => 'MangaController@forum'
|
||||
]);
|
||||
|
||||
|
0
tests/Http/Controllers/AnimeControllerTest.php → tests/HttpV3/Controllers/AnimeControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/AnimeControllerTest.php → tests/HttpV3/Controllers/AnimeControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/CharacterControllerTest.php → tests/HttpV3/Controllers/CharacterControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/CharacterControllerTest.php → tests/HttpV3/Controllers/CharacterControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ClubControllerTest.php → tests/HttpV3/Controllers/ClubControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ClubControllerTest.php → tests/HttpV3/Controllers/ClubControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/GenreControllerTest.php → tests/HttpV3/Controllers/GenreControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/GenreControllerTest.php → tests/HttpV3/Controllers/GenreControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/MagazineControllerTest.php → tests/HttpV3/Controllers/MagazineControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/MagazineControllerTest.php → tests/HttpV3/Controllers/MagazineControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/MangaControllerTest.php → tests/HttpV3/Controllers/MangaControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/MangaControllerTest.php → tests/HttpV3/Controllers/MangaControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/PersonControllerTest.php → tests/HttpV3/Controllers/PersonControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/PersonControllerTest.php → tests/HttpV3/Controllers/PersonControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ProducerControllerTest.php → tests/HttpV3/Controllers/ProducerControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ProducerControllerTest.php → tests/HttpV3/Controllers/ProducerControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ScheduleControllerTest.php → tests/HttpV3/Controllers/ScheduleControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/ScheduleControllerTest.php → tests/HttpV3/Controllers/ScheduleControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/SearchControllerTest.php → tests/HttpV3/Controllers/SearchControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/SearchControllerTest.php → tests/HttpV3/Controllers/SearchControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/SeasonControllerTest.php → tests/HttpV3/Controllers/SeasonControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/SeasonControllerTest.php → tests/HttpV3/Controllers/SeasonControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/TopControllerTest.php → tests/HttpV3/Controllers/TopControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/TopControllerTest.php → tests/HttpV3/Controllers/TopControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/UserControllerTest.php → tests/HttpV3/Controllers/UserControllerTest.php
Executable file → Normal file
0
tests/Http/Controllers/UserControllerTest.php → tests/HttpV3/Controllers/UserControllerTest.php
Executable file → Normal file
422
tests/HttpV4/Controllers/AnimeControllerTest.php
Normal file
422
tests/HttpV4/Controllers/AnimeControllerTest.php
Normal file
@ -0,0 +1,422 @@
|
||||
<?php
|
||||
|
||||
class AnimeControllerV4Test extends TestCase
|
||||
{
|
||||
public function testMain()
|
||||
{
|
||||
$this->get('/v4/anime/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'trailer' => [
|
||||
'youtube_id',
|
||||
'url',
|
||||
'embed_url',
|
||||
'images' => [
|
||||
'default_image_url',
|
||||
'small_image_url',
|
||||
'medium_image_url',
|
||||
'large_image_url',
|
||||
'maximum_image_url',
|
||||
]
|
||||
],
|
||||
'title',
|
||||
'title_english',
|
||||
'title_japanese',
|
||||
'title_synonyms',
|
||||
'type',
|
||||
'source',
|
||||
'episodes',
|
||||
'status',
|
||||
'airing',
|
||||
'aired' => [
|
||||
'from',
|
||||
'to',
|
||||
'prop' => [
|
||||
'from' => [
|
||||
'day',
|
||||
'month',
|
||||
'year'
|
||||
],
|
||||
'to' => [
|
||||
'day',
|
||||
'month',
|
||||
'year'
|
||||
]
|
||||
],
|
||||
'string'
|
||||
],
|
||||
'duration',
|
||||
'rating',
|
||||
'score',
|
||||
'scored_by',
|
||||
'rank',
|
||||
'popularity',
|
||||
'members',
|
||||
'favorites',
|
||||
'synopsis',
|
||||
'background',
|
||||
'premiered',
|
||||
'broadcast',
|
||||
'related' => [
|
||||
[
|
||||
'relation',
|
||||
'items' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
]
|
||||
],
|
||||
'producers' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'licensors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'studios' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'opening_themes',
|
||||
'ending_themes'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testCharactersStaff()
|
||||
{
|
||||
$this->get('/v4/anime/1/characters_staff')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'characters' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name',
|
||||
'voice_actors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'name',
|
||||
'image_url',
|
||||
'language'
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
'staff' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'name',
|
||||
'image_url',
|
||||
'positions'
|
||||
]
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function testEpisodes()
|
||||
{
|
||||
$this->get('/v4/anime/1/episodes')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'last_visible_page',
|
||||
'hast_next_page',
|
||||
'episodes' => [
|
||||
[
|
||||
'episode_id',
|
||||
'title',
|
||||
'title_japanese',
|
||||
'title_romanji',
|
||||
'aired',
|
||||
'filler',
|
||||
'recap',
|
||||
'video_url',
|
||||
'forum_url'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v4/anime/21/episodes?page=2')
|
||||
->seeStatusCode(200)
|
||||
->seeJson([
|
||||
'last_visible_page',
|
||||
'hast_next_page',
|
||||
'episodes' => [
|
||||
[
|
||||
'episode_id',
|
||||
'title',
|
||||
'title_japanese',
|
||||
'title_romanji',
|
||||
'aired',
|
||||
'filler',
|
||||
'recap',
|
||||
'video_url',
|
||||
'forum_url'
|
||||
]
|
||||
]
|
||||
])
|
||||
->seeJsonContains([
|
||||
'episodes' => [
|
||||
[
|
||||
'mal_id' => 101,
|
||||
'title' => 'Showdown in a Heat Haze! Ace vs. the Gallant Scorpion!'
|
||||
]
|
||||
]
|
||||
]);;
|
||||
}
|
||||
|
||||
public function testEpisode()
|
||||
{
|
||||
$this->get('/v4/anime/21/episodes/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'title_japanese',
|
||||
'title_romanji',
|
||||
'duration',
|
||||
'aired',
|
||||
'aired',
|
||||
'filler',
|
||||
'recap',
|
||||
'synopsis'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testNews()
|
||||
{
|
||||
$this->get('/v4/anime/1/news')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'articles' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'date',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'forum_url',
|
||||
'image_url',
|
||||
'comments',
|
||||
'excerpt'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testPictures()
|
||||
{
|
||||
$this->get('/v4/anime/1/pictures')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'images' => [
|
||||
[
|
||||
'large_image_url',
|
||||
'small_image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testVideos()
|
||||
{
|
||||
$this->get('/v4/anime/1/videos')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'promos' => [
|
||||
[
|
||||
'title',
|
||||
'image_url',
|
||||
'trailer' => [
|
||||
'youtube_id',
|
||||
'url',
|
||||
'embed_url',
|
||||
'images' => [
|
||||
'default_image_url',
|
||||
'small_image_url',
|
||||
'medium_image_url',
|
||||
'large_image_url',
|
||||
'maximum_image_url',
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
'episodes' => [
|
||||
[
|
||||
'mal_id',
|
||||
'title',
|
||||
'episode',
|
||||
'url',
|
||||
'image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testStats()
|
||||
{
|
||||
$this->get('/v4/anime/21/statistics')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'watching',
|
||||
'completed',
|
||||
'on_hold',
|
||||
'dropped',
|
||||
'plan_to_watch',
|
||||
'total',
|
||||
'scores' => [
|
||||
1 => [
|
||||
'votes',
|
||||
'percentage'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testForum()
|
||||
{
|
||||
$this->get('/v4/anime/1/forum')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'topics' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'date',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'replies',
|
||||
'last_comment' => [
|
||||
'url',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'date'
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMoreInfo()
|
||||
{
|
||||
$this->get('/v4/anime/1/moreinfo')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'moreinfo'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testReviews()
|
||||
{
|
||||
$this->get('/v4/anime/1/reviews')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'reviews' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'helpful_count',
|
||||
'date',
|
||||
'scores' => [
|
||||
'overall',
|
||||
'story',
|
||||
'animation',
|
||||
'sound',
|
||||
'character',
|
||||
'enjoyment'
|
||||
],
|
||||
'content',
|
||||
'reviewer' => [
|
||||
'url',
|
||||
'image_url',
|
||||
'username',
|
||||
'episodes_seen'
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v3/anime/1/reviews/100')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'reviews' => []
|
||||
]);
|
||||
}
|
||||
|
||||
public function testRecommendations()
|
||||
{
|
||||
$this->get('/v4/anime/1/recommendations')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'recommendations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'recommendation_url',
|
||||
'title',
|
||||
'recommendation_count'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserUpdates()
|
||||
{
|
||||
$this->get('/v4/anime/1/userupdates')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'recommendations' => [
|
||||
[
|
||||
'username',
|
||||
'url',
|
||||
'image_url',
|
||||
'score',
|
||||
'status',
|
||||
'episodes_seen',
|
||||
'episodes_total',
|
||||
'date'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v4/anime/1/userupdates/1000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v4/anime/2')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
67
tests/HttpV4/Controllers/CharacterControllerTest.php
Normal file
67
tests/HttpV4/Controllers/CharacterControllerTest.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
class CharacterControllerTest extends TestCase
|
||||
{
|
||||
public function testMain()
|
||||
{
|
||||
$this->get('/v3/character/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name',
|
||||
'name_kanji',
|
||||
'nicknames',
|
||||
'about',
|
||||
'member_favorites',
|
||||
'animeography' => [
|
||||
[
|
||||
'mal_id',
|
||||
'name',
|
||||
'url',
|
||||
'image_url',
|
||||
'role'
|
||||
]
|
||||
],
|
||||
'mangaography' => [
|
||||
[
|
||||
'mal_id',
|
||||
'name',
|
||||
'url',
|
||||
'image_url',
|
||||
'role'
|
||||
]
|
||||
],
|
||||
'voice_actors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'name',
|
||||
'url',
|
||||
'image_url',
|
||||
'language'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testPictures()
|
||||
{
|
||||
$this->get('/v3/character/1/pictures')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'pictures' => [
|
||||
[
|
||||
'large',
|
||||
'small',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/character/1000000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
77
tests/HttpV4/Controllers/ClubControllerTest.php
Normal file
77
tests/HttpV4/Controllers/ClubControllerTest.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
class ClubControllerTest extends TestCase
|
||||
{
|
||||
public function testMain()
|
||||
{
|
||||
$this->get('/v3/club/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'title',
|
||||
'members_count',
|
||||
'pictures_count',
|
||||
'category',
|
||||
'created',
|
||||
'type',
|
||||
'staff' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url',
|
||||
]
|
||||
],
|
||||
'anime_relations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url',
|
||||
]
|
||||
],
|
||||
'manga_relations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url',
|
||||
]
|
||||
],
|
||||
'character_relations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url',
|
||||
]
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMembers()
|
||||
{
|
||||
$this->get('/v3/club/1/members')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'members' => [
|
||||
[
|
||||
'username',
|
||||
'url',
|
||||
'image_url'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v3/club/1/members/1000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/club/1000000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
112
tests/HttpV4/Controllers/GenreControllerTest.php
Normal file
112
tests/HttpV4/Controllers/GenreControllerTest.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
class GenreControllerTest extends TestCase
|
||||
{
|
||||
public function testAnimeGenre()
|
||||
{
|
||||
$this->get('/v3/genre/anime/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_url' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
],
|
||||
'item_count',
|
||||
'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'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMangaGenre()
|
||||
{
|
||||
$this->get('/v3/genre/manga/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_url' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
],
|
||||
'item_count',
|
||||
'manga' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'image_url',
|
||||
'synopsis',
|
||||
'type',
|
||||
'publishing_start',
|
||||
'volumes',
|
||||
'members',
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'authors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'score',
|
||||
'serialization',
|
||||
// 'r18', todo ?
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/genre/anime/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/genre/manga/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/genre/anime/100')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/genre/manga/100')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
62
tests/HttpV4/Controllers/MagazineControllerTest.php
Normal file
62
tests/HttpV4/Controllers/MagazineControllerTest.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
class MagazineControllerTest extends TestCase
|
||||
{
|
||||
public function testMagazine()
|
||||
{
|
||||
$this->get('/v3/magazine/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'meta' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
],
|
||||
'manga' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'image_url',
|
||||
'synopsis',
|
||||
'type',
|
||||
'publishing_start',
|
||||
'volumes',
|
||||
'members',
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'authors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'score',
|
||||
'serialization',
|
||||
// 'r18', todo ?
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/magazine/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/magazine/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/magazine/100000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/magazine/100000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
276
tests/HttpV4/Controllers/MangaControllerTest.php
Normal file
276
tests/HttpV4/Controllers/MangaControllerTest.php
Normal file
@ -0,0 +1,276 @@
|
||||
<?php
|
||||
|
||||
class MangaControllerV4Test extends TestCase
|
||||
{
|
||||
public function testMain()
|
||||
{
|
||||
$this->get('/v4/manga/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'title',
|
||||
'title_english',
|
||||
'title_japanese',
|
||||
'title_synonyms',
|
||||
'type',
|
||||
'volumes',
|
||||
'chapters',
|
||||
'status',
|
||||
'publishing',
|
||||
'published' => [
|
||||
'from',
|
||||
'to',
|
||||
'prop' => [
|
||||
'from' => [
|
||||
'day',
|
||||
'month',
|
||||
'year'
|
||||
],
|
||||
'to' => [
|
||||
'day',
|
||||
'month',
|
||||
'year'
|
||||
]
|
||||
],
|
||||
'string'
|
||||
],
|
||||
'score',
|
||||
'scored_by',
|
||||
'rank',
|
||||
'popularity',
|
||||
'members',
|
||||
'favorites',
|
||||
'synopsis',
|
||||
'background',
|
||||
'related' => [
|
||||
[
|
||||
'relation',
|
||||
'items' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
]
|
||||
],
|
||||
'authors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'serializations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testCharacters()
|
||||
{
|
||||
$this->get('/v4/manga/1/characters')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'characters' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name',
|
||||
'role'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testNews()
|
||||
{
|
||||
$this->get('/v4/manga/1/news')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'articles' => [
|
||||
[
|
||||
'url',
|
||||
'title',
|
||||
'date',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'forum_url',
|
||||
'image_url',
|
||||
'comments',
|
||||
'excerpt'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testPictures()
|
||||
{
|
||||
$this->get('/v4/manga/1/pictures')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'images' => [
|
||||
[
|
||||
'large_image_url',
|
||||
'small_image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testStats()
|
||||
{
|
||||
$this->get('/v4/manga/1/statistics')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'reading',
|
||||
'completed',
|
||||
'on_hold',
|
||||
'dropped',
|
||||
'plan_to_read',
|
||||
'total',
|
||||
'scores' => [
|
||||
1 => [
|
||||
'votes',
|
||||
'percentage'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testForum()
|
||||
{
|
||||
$this->get('/v4/manga/1/forum')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'topics' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'date',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'replies',
|
||||
'last_comment' => [
|
||||
'url',
|
||||
'author_name',
|
||||
'author_url',
|
||||
'date'
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMoreInfo()
|
||||
{
|
||||
$this->get('/v4/manga/1/moreinfo')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'moreinfo'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testReviews()
|
||||
{
|
||||
$this->get('/v4/manga/1/reviews')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'reviews' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'helpful_count',
|
||||
'date',
|
||||
'scores' => [
|
||||
'overall',
|
||||
'story',
|
||||
'animation',
|
||||
'sound',
|
||||
'character',
|
||||
'enjoyment'
|
||||
],
|
||||
'content',
|
||||
'reviewer' => [
|
||||
'url',
|
||||
'image_url',
|
||||
'username',
|
||||
'episodes_seen'
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v4/manga/1/reviews/100')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'reviews' => []
|
||||
]);
|
||||
}
|
||||
|
||||
public function testRecommendations()
|
||||
{
|
||||
$this->get('/v4/manga/1/recommendations')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'recommendations' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'recommendation_url',
|
||||
'title',
|
||||
'recommendation_count'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserUpdates()
|
||||
{
|
||||
$this->get('/v4/manga/1/userupdates')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'users' => [
|
||||
[
|
||||
'username',
|
||||
'url',
|
||||
'image_url',
|
||||
'score',
|
||||
'status',
|
||||
'volumes_read',
|
||||
'volumes_total',
|
||||
'chapters_read',
|
||||
'chapters_total',
|
||||
'date'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->get('/v4/manga/1/userupdates/1000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v4/manga/1000000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
72
tests/HttpV4/Controllers/PersonControllerTest.php
Normal file
72
tests/HttpV4/Controllers/PersonControllerTest.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
class PersonControllerTest extends TestCase
|
||||
{
|
||||
public function testMain()
|
||||
{
|
||||
$this->get('/v3/person/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'website_url',
|
||||
'name',
|
||||
'given_name',
|
||||
'family_name',
|
||||
'alternate_names',
|
||||
'birthday',
|
||||
'about',
|
||||
'member_favorites',
|
||||
'voice_acting_roles' => [
|
||||
[
|
||||
'role',
|
||||
'anime' => [
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name'
|
||||
],
|
||||
'character' => [
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name'
|
||||
]
|
||||
]
|
||||
],
|
||||
'anime_staff_positions' => [
|
||||
[
|
||||
'position',
|
||||
'anime' => [
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name'
|
||||
],
|
||||
]
|
||||
],
|
||||
'published_manga' => []
|
||||
]);
|
||||
}
|
||||
|
||||
public function testPictures()
|
||||
{
|
||||
$this->get('/v3/person/1/pictures')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'pictures' => [
|
||||
[
|
||||
'large',
|
||||
'small',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/person/1000000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
64
tests/HttpV4/Controllers/ProducerControllerTest.php
Normal file
64
tests/HttpV4/Controllers/ProducerControllerTest.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
class ProducerControllerTest extends TestCase
|
||||
{
|
||||
public function testProducer()
|
||||
{
|
||||
$this->get('/v3/producer/1')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'meta' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
],
|
||||
'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'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/producer/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/producer/1/1000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/producer/100000')
|
||||
->seeStatusCode(404);
|
||||
$this->get('/v3/producer/100000')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
59
tests/HttpV4/Controllers/ScheduleControllerTest.php
Normal file
59
tests/HttpV4/Controllers/ScheduleControllerTest.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
class ScheduleControllerTest extends TestCase
|
||||
{
|
||||
public function testSchedule()
|
||||
{
|
||||
$this->get('/v3/schedule')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'monday' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'title',
|
||||
'synopsis',
|
||||
'type',
|
||||
'airing_start',
|
||||
'episodes',
|
||||
'members',
|
||||
'genres' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'source',
|
||||
'producers' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'score',
|
||||
'licensors',
|
||||
'r18',
|
||||
'kids'
|
||||
]
|
||||
],
|
||||
'tuesday',
|
||||
'wednesday',
|
||||
'thursday',
|
||||
'friday',
|
||||
'saturday',
|
||||
'sunday',
|
||||
'other',
|
||||
'unknown'
|
||||
]);
|
||||
}
|
||||
|
||||
public function test400()
|
||||
{
|
||||
$this->get('/v3/schedule/asdjkhas')
|
||||
->seeStatusCode(400);
|
||||
}
|
||||
}
|
102
tests/HttpV4/Controllers/SearchControllerTest.php
Normal file
102
tests/HttpV4/Controllers/SearchControllerTest.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
class SearchControllerTest extends TestCase
|
||||
{
|
||||
public function testAnimeSearch()
|
||||
{
|
||||
$this->get('/v3/search/anime?order_by=id&sort=asc')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'results' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'title',
|
||||
'airing',
|
||||
'synopsis',
|
||||
'type',
|
||||
'episodes',
|
||||
'score',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'members',
|
||||
'rated'
|
||||
]
|
||||
]
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function testMangaSearch()
|
||||
{
|
||||
$this->get('/v3/search/manga?order_by=id&sort=asc')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'results' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'title',
|
||||
'publishing',
|
||||
'synopsis',
|
||||
'type',
|
||||
'chapters',
|
||||
'volumes',
|
||||
'score',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'members',
|
||||
]
|
||||
]
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function testPeopleSearch()
|
||||
{
|
||||
$this->get('/v3/search/people?q=Sawano')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'results' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name',
|
||||
'alternative_names',
|
||||
]
|
||||
]
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function testCharacterSearch()
|
||||
{
|
||||
$this->get('/v3/search/character?q=Okabe,%20Rintarou')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'results' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name',
|
||||
'alternative_names',
|
||||
'anime' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name', // todo should be `title`
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'manga' => [],
|
||||
]
|
||||
],
|
||||
'last_page'
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
49
tests/HttpV4/Controllers/SeasonControllerTest.php
Normal file
49
tests/HttpV4/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'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
111
tests/HttpV4/Controllers/TopControllerTest.php
Normal file
111
tests/HttpV4/Controllers/TopControllerTest.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
class TopControllerTest extends TestCase
|
||||
{
|
||||
public function testTopAnime()
|
||||
{
|
||||
$this->get('/v3/top/anime')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'top' => [
|
||||
[
|
||||
'mal_id',
|
||||
'rank',
|
||||
'title',
|
||||
'url',
|
||||
'image_url',
|
||||
'type',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'members',
|
||||
'score',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testTopManga()
|
||||
{
|
||||
$this->get('/v3/top/manga')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'top' => [
|
||||
[
|
||||
'mal_id',
|
||||
'rank',
|
||||
'title',
|
||||
'url',
|
||||
'type',
|
||||
'volumes',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'members',
|
||||
'score',
|
||||
'image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testTopPeople()
|
||||
{
|
||||
$this->get('/v3/top/people')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'top' => [
|
||||
[
|
||||
'mal_id',
|
||||
'rank',
|
||||
'title', // todo should be `name`
|
||||
'url',
|
||||
'name_kanji',
|
||||
'favorites',
|
||||
'image_url',
|
||||
'birthday',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testTopCharacters()
|
||||
{
|
||||
$this->get('/v3/top/characters')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'top' => [
|
||||
[
|
||||
'mal_id',
|
||||
'rank',
|
||||
'title', // todo should be `name`
|
||||
'url',
|
||||
'name_kanji',
|
||||
|
||||
'animeography' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'mangaography' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'favorites',
|
||||
'image_url',
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function test404()
|
||||
{
|
||||
$this->get('/v3/top/anime/999')
|
||||
->seeStatusCode(404);
|
||||
}
|
||||
}
|
171
tests/HttpV4/Controllers/UserControllerTest.php
Normal file
171
tests/HttpV4/Controllers/UserControllerTest.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
class UserControllerTest extends TestCase
|
||||
{
|
||||
public function testUserProfile()
|
||||
{
|
||||
$this->get('/v3/user/nekomata1037')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'username',
|
||||
'url',
|
||||
'image_url',
|
||||
'last_online',
|
||||
'gender',
|
||||
'birthday',
|
||||
'location',
|
||||
'joined',
|
||||
'anime_stats' => [
|
||||
'days_watched',
|
||||
'mean_score',
|
||||
'watching',
|
||||
'completed',
|
||||
'on_hold',
|
||||
'dropped',
|
||||
'plan_to_watch',
|
||||
'total_entries',
|
||||
'rewatched',
|
||||
'episodes_watched'
|
||||
],
|
||||
'manga_stats' => [
|
||||
'days_read',
|
||||
'mean_score',
|
||||
'reading',
|
||||
'completed',
|
||||
'on_hold',
|
||||
'dropped',
|
||||
'plan_to_read',
|
||||
'total_entries',
|
||||
'reread',
|
||||
'chapters_read',
|
||||
'volumes_read'
|
||||
],
|
||||
'favorites' => [
|
||||
'anime' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name' // todo should be `title`
|
||||
]
|
||||
],
|
||||
'manga' => [],
|
||||
'characters' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name'
|
||||
]
|
||||
],
|
||||
'people' => [
|
||||
[
|
||||
'mal_id',
|
||||
'url',
|
||||
'image_url',
|
||||
'name'
|
||||
]
|
||||
],
|
||||
],
|
||||
'about'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserHistory()
|
||||
{
|
||||
$this->get('/v3/user/nekomata1037/history')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'history' => [
|
||||
[
|
||||
'meta' => [
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
],
|
||||
'increment',
|
||||
'date'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserFriends()
|
||||
{
|
||||
$this->get('/v3/user/nekomata1037/friends')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'friends' => [
|
||||
[
|
||||
'url',
|
||||
'username',
|
||||
'image_url',
|
||||
'last_online',
|
||||
'friends_since'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserAnimeList()
|
||||
{
|
||||
$this->get('/v3/user/nekomata1037/animelist?order_by=last_updated&sort=descending')
|
||||
->seeStatusCode(200)
|
||||
->seeJsonStructure([
|
||||
'anime' => [
|
||||
[
|
||||
'mal_id',
|
||||
'title',
|
||||
'video_url',
|
||||
'url',
|
||||
'image_url',
|
||||
'type',
|
||||
'watching_status',
|
||||
'score',
|
||||
'watched_episodes',
|
||||
'total_episodes',
|
||||
'airing_status',
|
||||
'season_name',
|
||||
'season_year',
|
||||
'has_episode_video',
|
||||
'has_promo_video',
|
||||
'has_video',
|
||||
'is_rewatching',
|
||||
'tags',
|
||||
'rating',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'watch_start_date',
|
||||
'watch_end_date',
|
||||
'days',
|
||||
'storage',
|
||||
'priority',
|
||||
'added_to_list',
|
||||
'studios' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
'licensors' => [
|
||||
[
|
||||
'mal_id',
|
||||
'type',
|
||||
'name',
|
||||
'url'
|
||||
]
|
||||
],
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUserMangaList()
|
||||
{
|
||||
$this->get('/v3/user/nekomata1037/mangalist?order_by=last_updated&sort=descending')
|
||||
->seeStatusCode(400);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user