mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 21:16:13 +00:00
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* 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\SocialWork\SocialIssue;
|
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
|
|
|
/**
|
|
* @internal
|
|
*
|
|
* @coversNothing
|
|
*/
|
|
final class SocialIssueNormalizerTest extends KernelTestCase
|
|
{
|
|
private NormalizerInterface $normalizer;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
self::bootKernel();
|
|
$this->normalizer = self::getContainer()->get(NormalizerInterface::class);
|
|
}
|
|
|
|
public function testNormalization()
|
|
{
|
|
$si = new SocialIssue();
|
|
|
|
$normalized = $this->normalizer->normalize(
|
|
$si,
|
|
'json',
|
|
['groups' => ['read']]
|
|
);
|
|
|
|
$this->assertIsArray($normalized);
|
|
$this->assertArrayHasKey('type', $normalized);
|
|
$this->assertEquals('social_issue', $normalized['type']);
|
|
}
|
|
}
|