From 785342c2599c313885690f20cf93c02420126552 Mon Sep 17 00:00:00 2001 From: Artem Henvald Date: Thu, 14 Mar 2024 14:37:39 +0200 Subject: [PATCH] Update DtoExtractorTest.php --- Tests/Request/DtoExtractorTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tests/Request/DtoExtractorTest.php b/Tests/Request/DtoExtractorTest.php index d08638b..675eb23 100644 --- a/Tests/Request/DtoExtractorTest.php +++ b/Tests/Request/DtoExtractorTest.php @@ -21,6 +21,7 @@ use StfalconStudio\ApiBundle\Service\AttributeProcessor\DtoAttributeProcessor; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; +use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer; use Symfony\Component\Serializer\SerializerInterface; /** @@ -88,8 +89,17 @@ public function testGetDtoFromRequestWithoutPopulation(?object $objectToPopulate public static function dataProvider(): iterable { - yield [null, []]; - yield [new \stdClass(), [AbstractNormalizer::OBJECT_TO_POPULATE => new \stdClass()]]; + yield [ + 'object_to_populate' => null, + 'context' => [], + ]; + yield [ + 'object_to_populate' => new \stdClass(), + 'context' => [ + AbstractNormalizer::OBJECT_TO_POPULATE => new \stdClass(), + AbstractObjectNormalizer::DEEP_OBJECT_TO_POPULATE => true, + ] + ]; } public function testExceptionOnDtoWithoutInterface(): void