8000 minor #57825 [PropertyInfo] fix tests (xabbuh) · symfony/symfony@55b9402 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55b9402

Browse files
committed
minor #57825 [PropertyInfo] fix tests (xabbuh)
This PR was merged into the 7.1 branch. Discussion ---------- [PropertyInfo] fix tests | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT following #57618 Commits ------- 7192dd1 fix tests
2 parents 28dcc15 + 7192dd1 commit 55b9402

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use Symfony\Component\PropertyInfo\Tests\Fixtures\SnakeCaseDummy;
3434
use Symfony\Component\PropertyInfo\Type as LegacyType;
3535
use Symfony\Component\TypeInfo\Type;
36+
use Symfony\Component\TypeInfo\TypeResolver\PhpDocAwareReflectionTypeResolver;
3637

3738
/**
3839
* @author Kévin Dunglas <dunglas@gmail.com>
@@ -696,9 +697,9 @@ public function testExtractors(string $property, ?Type $type)
696697
*/
697698
public static function typesProvider(): iterable
698699
{
699-
yield ['a', null];
700+
yield ['a', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null];
700701
yield ['b', Type::nullable(Type::object(ParentDummy::class))];
701-
yield ['e', null];
702+
yield ['e', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::list(Type::resource()) : null];
702703
yield ['f', Type::list(Type::object(\DateTimeImmutable::class))];
703704
yield ['donotexist', null];
704705
yield ['staticGetter', null];
@@ -881,8 +882,8 @@ public function testExtractConstructorType(string $property, ?Type $type)
881882
public static function extractConstructorTypesProvider(): iterable
882883
{
883884
yield ['timezone', Type::object(\DateTimeZone::class)];
884-
yield ['date', null];
885-
yield ['dateObject', null];
885+
yield ['date', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null];
886+
yield ['dateObject', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::object(\DateTimeInterface::class) : null];
886887
yield ['dateTime', Type::object(\DateTimeImmutable::class)];
887888
yield ['ddd', null];
888889
}

0 commit comments

Comments
 (0)
0