2019-01-02 04:02:18 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Flarum.
|
|
|
|
*
|
2019-11-28 08:16:50 +08:00
|
|
|
* For detailed copyright and license information, please view the
|
|
|
|
* LICENSE file that was distributed with this source code.
|
2019-01-02 04:02:18 +08:00
|
|
|
*/
|
|
|
|
|
2020-03-27 19:22:22 +08:00
|
|
|
namespace Flarum\Tests\integration\api\groups;
|
2019-01-02 04:02:18 +08:00
|
|
|
|
|
|
|
use Flarum\Group\Group;
|
2020-03-27 19:22:22 +08:00
|
|
|
use Flarum\Tests\integration\TestCase;
|
2019-01-02 04:02:18 +08:00
|
|
|
|
2020-03-27 19:22:22 +08:00
|
|
|
class ListTest extends TestCase
|
2019-01-02 04:02:18 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function shows_index_for_guest()
|
|
|
|
{
|
2020-03-27 19:22:22 +08:00
|
|
|
$response = $this->send(
|
|
|
|
$this->request('GET', '/api/groups')
|
|
|
|
);
|
2019-01-02 04:02:18 +08:00
|
|
|
|
|
|
|
$this->assertEquals(200, $response->getStatusCode());
|
|
|
|
$data = json_decode($response->getBody()->getContents(), true);
|
|
|
|
|
|
|
|
$this->assertEquals(Group::count(), count($data['data']));
|
|
|
|
}
|
|
|
|
}
|