diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php index d5e5c676727ed..ab4ea901e299a 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php @@ -33,6 +33,7 @@ use Symfony\Component\PropertyInfo\Tests\Fixtures\SnakeCaseDummy; use Symfony\Component\PropertyInfo\Type as LegacyType; use Symfony\Component\TypeInfo\Type; +use Symfony\Component\TypeInfo\TypeResolver\PhpDocAwareReflectionTypeResolver; /** * @author Kévin Dunglas @@ -696,9 +697,9 @@ public function testExtractors(string $property, ?Type $type) */ public static function typesProvider(): iterable { - yield ['a', null]; + yield ['a', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null]; yield ['b', Type::nullable(Type::object(ParentDummy::class))]; - yield ['e', null]; + yield ['e', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::list(Type::resource()) : null]; yield ['f', Type::list(Type::object(\DateTimeImmutable::class))]; yield ['donotexist', null]; yield ['staticGetter', null]; @@ -881,8 +882,8 @@ public function testExtractConstructorType(string $property, ?Type $type) public static function extractConstructorTypesProvider(): iterable { yield ['timezone', Type::object(\DateTimeZone::class)]; - yield ['date', null]; - yield ['dateObject', null]; + yield ['date', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null]; + yield ['dateObject', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::object(\DateTimeInterface::class) : null]; yield ['dateTime', Type::object(\DateTimeImmutable::class)]; yield ['ddd', null]; }