From c022deb66a7e42310721b3573566076ea2ddc9f6 Mon Sep 17 00:00:00 2001 From: Oliver Hader Date: Mon, 19 Feb 2024 12:08:46 +0100 Subject: [PATCH] Add more tests for native intersection types in class properties --- tests/NativeIntersectionsTest.php | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/NativeIntersectionsTest.php b/tests/NativeIntersectionsTest.php index ade439a5f11..72b9f121337 100644 --- a/tests/NativeIntersectionsTest.php +++ b/tests/NativeIntersectionsTest.php @@ -53,6 +53,64 @@ function test(A&B $in): void { 'ignored_issues' => [], 'php_version' => '8.1', ], + 'nativeTypeIntersectionAsClassProperty' => [ + 'code' => 'intersection = new C(); + } + } + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '8.1', + ], + 'nativeTypeIntersectionAsClassPropertyUsingProcessedInterfaces' => [ + 'code' => 'other = new AB(); + } + } + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '8.1', + ], + 'nativeTypeIntersectionAsClassPropertyUsingUnprocessedInterfaces' => [ + 'code' => 'other = new StringableJson(); + } + } + ', + 'assertions' => [], + 'ignored_issues' => [], + 'php_version' => '8.1', + ], ]; }