mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
29 lines
820 B
PHP
29 lines
820 B
PHP
<?php
|
|
|
|
namespace Serializer\Normalizer;
|
|
|
|
use Chill\PersonBundle\Entity\Person;
|
|
use Chill\PersonBundle\Serializer\Normalizer\PersonJsonNormalizer;
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
|
|
|
class PersonJsonNormalizerTest extends KernelTestCase
|
|
{
|
|
private NormalizerInterface $normalizer;
|
|
|
|
protected function setUp()
|
|
{
|
|
self::bootKernel();
|
|
$this->normalizer = self::$container->get(NormalizerInterface::class);
|
|
}
|
|
|
|
public function testNormalization()
|
|
{
|
|
$person = new Person();
|
|
$result = $this->normalizer->normalize($person, 'json', [AbstractNormalizer::GROUPS => [ 'read' ]]);
|
|
|
|
$this->assertIsArray($result);
|
|
}
|
|
}
|