add Club tests #50

This commit is contained in:
Irfan 2019-05-13 08:52:55 +05:00
parent 252671cf7d
commit 8557a43a5f
2 changed files with 78 additions and 0 deletions

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

View File

@ -0,0 +1 @@
<?php