fix CalendarNormalizerTest.php

This commit is contained in:
2025-09-11 14:03:01 +02:00
parent b363bd3425
commit 90f86bf566

View File

@@ -13,6 +13,7 @@ namespace Chill\CalendarBundle\Tests\Serializer\Normalizer;
use Chill\CalendarBundle\Entity\Calendar;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\Person;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
@@ -45,6 +46,8 @@ final class CalendarNormalizerTest extends KernelTestCase
->setEndDate(\DateTimeImmutable::createFromFormat(\DateTimeImmutable::ATOM, '2020-15-15T15:30:00+0000'))
->addPerson(new Person())
->addPerson(new Person())
->setLocation(new Location())
->setMainUser(new User())
->addUser(new User())
->addProfessional(new ThirdParty());
@@ -87,23 +90,23 @@ final class CalendarNormalizerTest extends KernelTestCase
$this->assertArrayHasKey('duration', $actual);
$this->assertIsArray($actual['duration']);
}
// test doesn't make sense in symfony72 because null will be normalized as []
/* public function testNormalizationOnNullHasSameKeys(): void
{
$calendar = new Calendar();
public function testNormalizationOnNullHasSameKeys(): void
{
$calendar = new Calendar();
$notNullCalendar = $this->normalizer->normalize(
$calendar,
'docgen',
['groups' => ['docgen:read'], 'docgen:expects' => Calendar::class]
);
$notNullCalendar = $this->normalizer->normalize(
$calendar,
'docgen',
['groups' => ['docgen:read'], 'docgen:expects' => Calendar::class]
);
$isNullCalendar = $this->normalizer->normalize(
null,
'docgen',
['groups' => ['docgen:read'], 'docgen:expects' => Calendar::class]
);
$isNullCalendar = $this->normalizer->normalize(
null,
'docgen',
['groups' => ['docgen:read'], 'docgen:expects' => Calendar::class]
);
$this->assertEqualsCanonicalizing(array_keys($notNullCalendar), array_keys($isNullCalendar));
}
$this->assertEqualsCanonicalizing(array_keys($notNullCalendar), array_keys($isNullCalendar));
}*/
}