Skip to content

Commit

Permalink
Update DtoExtractorTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h authored Mar 14, 2024
1 parent 19dceaf commit ff5e19c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Tests/Request/DtoExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ff5e19c

Please sign in to comment.