8000 fix tests · symfony/symfony@7192dd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7192dd1

Browse files
committed
fix tests
1 parent 28dcc15 commit 7192dd1

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