framework/tests/integration/api/groups/ListTest.php
2020-03-27 13:21:10 +01:00

32 lines
706 B
PHP

<?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']));
}
}