mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-22 22:55:00 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -14,60 +14,57 @@ namespace Chill\PersonBundle\Tests\Controller;
|
||||
use Chill\MainBundle\Test\PrepareClientTrait;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Iterator;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use function array_pop;
|
||||
use function json_decode;
|
||||
use function shuffle;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class PersonApiControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public function dataGetPersonFromCenterA(): Iterator
|
||||
public function dataGetPersonFromCenterA(): \Iterator
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$personIds = $em->createQuery(sprintf(
|
||||
"SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center",
|
||||
'SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center',
|
||||
Person::class
|
||||
))
|
||||
->setParameter('center', 'Center A')
|
||||
->setMaxResults(100)
|
||||
->getScalarResult();
|
||||
|
||||
shuffle($personIds);
|
||||
\shuffle($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
}
|
||||
|
||||
public function dataGetPersonFromCenterB(): Iterator
|
||||
public function dataGetPersonFromCenterB(): \Iterator
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$personIds = $em->createQuery(
|
||||
sprintf("SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center", Person::class)
|
||||
sprintf('SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center', Person::class)
|
||||
)
|
||||
->setParameter('center', 'Center B')
|
||||
->setMaxResults(100)
|
||||
->getScalarResult();
|
||||
|
||||
shuffle($personIds);
|
||||
\shuffle($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
|
||||
yield array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +104,7 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
$data = \json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertArrayHasKey('type', $data);
|
||||
$this->assertArrayHasKey('id', $data);
|
||||
|
Reference in New Issue
Block a user