1
0
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:
Franz Liedke
2020-03-27 12:22:22 +01:00
parent bc7cea6e61
commit e3f1e69748
5 changed files with 158 additions and 125 deletions

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