From 93d32099aa6fdc4d681835f7c29f927bd063306b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Jul 2024 22:22:20 +0200 Subject: [PATCH] add tests for TypeInfo types This change ensures that the tests that have been added in #57617 are also applied when the types from the TypeInfo component are used instead of the Type class that is built into the PropertyInfo component. --- .../PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php | 1 + .../PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php index 7ba5839f59eab..06fc50e5df39e 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php @@ -571,6 +571,7 @@ public static function typeProvider(): iterable yield ['arrayOfMixed', Type::dict(Type::mixed()), null, null]; yield ['listOfStrings', Type::list(Type::string()), null, null]; yield ['self', Type::object(Dummy::class), null, null]; + yield ['collectionAsObject', Type::collection(Type::object(DummyCollection::class), Type::string(), Type::int()), null, null]; } /** diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php index a1dd8d54152f5..109d54f0898cf 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php @@ -594,6 +594,7 @@ public static function typesProvider(): iterable yield ['self', Type::object(Dummy::class)]; yield ['rootDummyItems', Type::list(Type::object(RootDummyItem::class))]; yield ['rootDummyItem', Type::object(RootDummyItem::class)]; + yield ['collectionAsObject', Type::collection(Type::object(DummyCollection::class), Type::string(), Type::int())]; } public function testParamTagTypeIsOmitted()