mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
60 lines
1.5 KiB
PHP
60 lines
1.5 KiB
PHP
<?php
|
|
|
|
class ClubControllerTest extends TestCase
|
|
{
|
|
public function testMain()
|
|
{
|
|
$this->get('/v4/clubs/1')
|
|
->seeStatusCode(200)
|
|
->seeJsonStructure(['data'=>[
|
|
'mal_id',
|
|
'name',
|
|
'url',
|
|
'images' => [
|
|
'jpg' => [
|
|
'image_url',
|
|
],
|
|
],
|
|
'members',
|
|
'category',
|
|
'created',
|
|
'access',
|
|
]]);
|
|
}
|
|
|
|
public function testMembers()
|
|
{
|
|
$this->get('/v4/clubs/1/members')
|
|
->seeStatusCode(200)
|
|
->seeJsonStructure([
|
|
'pagination' => [
|
|
'last_visible_page',
|
|
'has_next_page',
|
|
],
|
|
'data' => [
|
|
[
|
|
'username',
|
|
'url',
|
|
'images' => [
|
|
'jpg' => [
|
|
'image_url'
|
|
],
|
|
'webp' => [
|
|
'image_url'
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]);
|
|
|
|
$this->get('/v4/clubs/1000000/members')
|
|
->seeStatusCode(404);
|
|
}
|
|
|
|
public function test404()
|
|
{
|
|
$this->get('/v4/clubs/1000000')
|
|
->seeStatusCode(404);
|
|
}
|
|
}
|