mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 18:39:43 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,15 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Tests\Controller;
|
||||
|
||||
use Chill\MainBundle\Test\PrepareClientTrait;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use function array_key_exists;
|
||||
use function json_decode;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class UserApiControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
/**
|
||||
* @depends testIndex
|
||||
*
|
||||
* @param mixed $existingUser
|
||||
*/
|
||||
public function testEntity($existingUser)
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(Request::METHOD_GET, '/api/1.0/main/user/' . $existingUser['id'] . '.json');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testIndex()
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
@@ -18,26 +45,14 @@ class UserApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
$data = \json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertTrue(\array_key_exists('count', $data));
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertTrue(array_key_exists('count', $data));
|
||||
$this->assertGreaterThan(0, $data['count']);
|
||||
$this->assertTrue(\array_key_exists('results', $data));
|
||||
$this->assertTrue(array_key_exists('results', $data));
|
||||
|
||||
return $data['results'][0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testIndex
|
||||
*/
|
||||
public function testEntity($existingUser)
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(Request::METHOD_GET, '/api/1.0/main/user/'.$existingUser['id'].'.json');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testWhoami()
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
Reference in New Issue
Block a user