mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix normalization for null accompanying period docgen
This commit is contained in:
parent
dfb583fa8b
commit
0cfad13720
@ -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,
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user