mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Add test
This commit is contained in:
parent
d3b7f3f0b4
commit
76458e0b50
@ -73,6 +73,20 @@ class ArrayAssignmentTest extends TestCase
|
|||||||
'$result===' => 'array{a::class: true, b::class: true}',
|
'$result===' => 'array{a::class: true, b::class: true}',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'assignUnionOfLiteralsClassKeys2' => [
|
||||||
|
'code' => '<?php
|
||||||
|
class a {}
|
||||||
|
class b {}
|
||||||
|
|
||||||
|
$result = ["c" => true];
|
||||||
|
|
||||||
|
foreach ([a::class, b::class] as $k) {
|
||||||
|
$result[$k] = true;
|
||||||
|
}',
|
||||||
|
'assertions' => [
|
||||||
|
'$result===' => 'array{a::class: true, b::class: true, c: true}',
|
||||||
|
],
|
||||||
|
],
|
||||||
'genericArrayCreationWithSingleIntValue' => [
|
'genericArrayCreationWithSingleIntValue' => [
|
||||||
'code' => '<?php
|
'code' => '<?php
|
||||||
$out = [];
|
$out = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user