From 76458e0b50d8871366b0f72c257562dafc592859 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 6 Dec 2023 14:52:54 +0100 Subject: [PATCH] Add test --- tests/ArrayAssignmentTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/ArrayAssignmentTest.php b/tests/ArrayAssignmentTest.php index 790f901b3..713756ad2 100644 --- a/tests/ArrayAssignmentTest.php +++ b/tests/ArrayAssignmentTest.php @@ -73,6 +73,20 @@ class ArrayAssignmentTest extends TestCase '$result===' => 'array{a::class: true, b::class: true}', ], ], + 'assignUnionOfLiteralsClassKeys2' => [ + 'code' => ' true]; + + foreach ([a::class, b::class] as $k) { + $result[$k] = true; + }', + 'assertions' => [ + '$result===' => 'array{a::class: true, b::class: true, c: true}', + ], + ], 'genericArrayCreationWithSingleIntValue' => [ 'code' => '