Add Watch Tests

This commit is contained in:
Irfan 2021-01-14 07:50:46 +05:00
parent 598d915bdc
commit e10c83c130

View File

@ -0,0 +1,182 @@
<?php
class WatchControllerTest extends TestCase
{
public function testWatchEpisodes()
{
$this->get('/v4/watch/episodes')
->seeStatusCode(200)
->seeJsonStructure([
'meta' => [
'last_visible_page',
'hast_next_page',
],
'data' => [
[
'entry' => [
[
'mal_id',
'url',
'images' => [
'jpg' => [
'image_url',
'small_image_url',
'large_image_url'
],
'webp' => [
'image_url',
'small_image_url',
'large_image_url'
],
],
'title'
]
],
'episodes' => [
[
'mal_id',
'url',
'name',
'premium'
]
],
]
]
]);
$this->get('/v4/watch/popular')
->seeStatusCode(200)
->seeJsonStructure([
'meta' => [
'last_visible_page',
'hast_next_page',
],
'data' => [
[
'entry' => [
[
'mal_id',
'url',
'images' => [
'jpg' => [
'image_url',
'small_image_url',
'large_image_url'
],
'webp' => [
'image_url',
'small_image_url',
'large_image_url'
],
],
'title'
]
],
'episodes' => [
[
'mal_id',
'url',
'name',
'premium'
]
],
]
]
]);
}
public function testWatchPromos()
{
$this->get('/v4/watch/promos')
->seeStatusCode(200)
->seeJsonStructure([
'meta' => [
'last_visible_page',
'hast_next_page',
],
'data' => [
[
'title',
'entry' => [
[
'mal_id',
'url',
'images' => [
'jpg' => [
'image_url',
'small_image_url',
'large_image_url'
],
'webp' => [
'image_url',
'small_image_url',
'large_image_url'
],
],
'title'
]
],
'trailer' => [
'youtube_id',
'url',
'embed_url',
'images' => [
'default_image_url',
'small_image_url',
'medium_image_url',
'large_image_url',
'maximum_image_url',
]
],
]
]
]);
$this->get('/v4/watch/popular')
->seeStatusCode(200)
->seeJsonStructure([
'meta' => [
'last_visible_page',
'hast_next_page',
],
'data' => [
[
'title',
'entry' => [
[
'mal_id',
'url',
'images' => [
'jpg' => [
'image_url',
'small_image_url',
'large_image_url'
],
'webp' => [
'image_url',
'small_image_url',
'large_image_url'
],
],
'title'
]
],
'trailer' => [
'youtube_id',
'url',
'embed_url',
'images' => [
'default_image_url',
'small_image_url',
'medium_image_url',
'large_image_url',
'maximum_image_url',
]
],
]
]
]);
}
}