mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
normalization for docgen:read: add groups and so on (wip)
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
@@ -79,6 +80,22 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testNormalizeParticipations()
|
||||
{
|
||||
$period = new AccompanyingPeriod();
|
||||
$period->addPerson($person = new Person());
|
||||
$person->setFirstName('test');
|
||||
|
||||
$data = $this->normalizer->normalize($period, 'docgen', ['docgen:expects' => AccompanyingPeriod::class]);
|
||||
|
||||
$this->assertIsArray($data);
|
||||
$this->assertArrayHasKey('participations', $data);
|
||||
$this->assertCount(1, $data['participations']);
|
||||
|
||||
$this->assertArrayHasKey('currentParticipations', $data);
|
||||
$this->assertCount(1, $data['currentParticipations']);
|
||||
}
|
||||
|
||||
public function testNormalizeNull()
|
||||
{
|
||||
$data = $this->normalizer->normalize(null, 'docgen', ['docgen:expects' => AccompanyingPeriod::class]);
|
||||
|
Reference in New Issue
Block a user