cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,16 +1,26 @@
<?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\PersonBundle\Tests\Serializer\Normalizer;
use Chill\PersonBundle\Entity\Household\Position;
use Chill\PersonBundle\Entity\Household\Household;
use Chill\PersonBundle\Entity\Household\HouseholdMember;
use Chill\PersonBundle\Entity\Household\Position;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerInterface;
use DateTimeImmutable;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* @internal
* @coversNothing
*/
class HouseholdNormalizerTest extends KernelTestCase
{
private ?NormalizerInterface $normalizer;
@@ -18,7 +28,7 @@ class HouseholdNormalizerTest extends KernelTestCase
protected function setUp()
{
self::bootKernel();
$this->normalizer= self::$container->get(NormalizerInterface::class);
$this->normalizer = self::$container->get(NormalizerInterface::class);
}
public function testNormalizationRecursive()
@@ -28,21 +38,22 @@ class HouseholdNormalizerTest extends KernelTestCase
$household = new Household();
$position = (new Position())
->setShareHousehold(true)
->setAllowHolder(true)
;
->setAllowHolder(true);
$member->setPerson($person)
->setStartDate(new \DateTimeImmutable('1 year ago'))
->setEndDate(new \DateTimeImmutable('1 month ago'));
->setStartDate(new DateTimeImmutable('1 year ago'))
->setEndDate(new DateTimeImmutable('1 month ago'));
$household->addMember($member);
$normalized = $this->normalizer->normalize($household,
'json', [ 'groups' => [ 'read' ]]);
$normalized = $this->normalizer->normalize(
$household,
'json',
['groups' => ['read']]
);
$this->assertIsArray($normalized);
$this->assertArrayHasKey('type', $normalized);
$this->assertEquals('household', $normalized['type']);
}
}