mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Convert more controller tests to request tests
This commit is contained in:
31
tests/integration/api/groups/ListTest.php
Normal file
31
tests/integration/api/groups/ListTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Tests\integration\api\groups;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\Tests\integration\TestCase;
|
||||
|
||||
class ListTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shows_index_for_guest()
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('GET', '/api/groups')
|
||||
);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$data = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$this->assertEquals(Group::count(), count($data['data']));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user