diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index 79adc560c..86deda604 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -44,6 +44,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf private const PERIOD_NULL = [ 'id', 'closingDate' => DateTime::class, + 'closingMotive' => AccompanyingPeriod\ClosingMotive::class, 'confidential', 'confidentialText', 'createdAt' => DateTime::class, diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php index 58ca55262..c42dc9a5a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php @@ -65,6 +65,7 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase 'type' => 'accompanying_period', 'isNull' => false, 'closingDate' => '@ignored', + 'closingMotive' => '@ignored', 'confidential' => true, 'confidentialText' => 'confidentiel', 'createdAt' => '@ignored', @@ -121,59 +122,7 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase { $data = $this->normalizer->normalize(null, 'docgen', ['docgen:expects' => AccompanyingPeriod::class]); - $expected = [ - 'id' => '', - 'type' => 'accompanying_period', - 'closingDate' => '@ignored', - 'confidential' => false, - 'confidentialText' => '', - 'createdAt' => '@ignored', - 'createdBy' => '@ignored', - 'emergency' => false, - 'emergencyText' => '', - 'openingDate' => '@ignored', - 'originText' => '', - 'origin' => '@ignored', - 'requestorAnonymous' => false, - 'resources' => [], - 'socialIssues' => '@ignored', - 'intensity' => '', - 'step' => '', - 'closingMotiveText' => '', - 'socialIssuesText' => '', - 'scopes' => '@ignored', - 'scopesText' => '', - 'ref' => '@ignored', - 'participations' => '@ignored', - 'currentParticipations' => '@ignored', - 'isClosed' => false, - 'hasRef' => false, - 'hasRequestor' => false, - 'requestorKind' => 'none', - 'hasRequestorPerson' => false, - 'hasRequestorThirdParty' => false, - 'requestorPerson' => '@ignored', - 'requestorThirdParty' => '@ignored', - 'isNull' => true, - 'administrativeLocation' => '@ignored', - 'hasAdministrativeLocation' => false, - 'hasLocation' => false, - 'hasLocationPerson' => false, - 'location' => '@ignored', - 'locationPerson' => '@ignored', - 'works' => [], - ]; - $this->assertIsArray($data); - $this->assertEqualsCanonicalizing(array_keys($expected), array_keys($data)); - - foreach ($expected as $key => $item) { - if ('@ignored' === $item) { - continue; - } - - $this->assertEquals($item, $data[$key], "test the key {$key}"); - } } public function testNormalizeParticipations()