Skip to content

Commit 96773a4

Browse files
committed
add type combinator tests
Addresses #3613 (comment), #3613 (comment)
1 parent 668d970 commit 96773a4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/PHPStan/Type/TypeCombinatorTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,6 +2050,14 @@ public function dataUnion(): iterable
20502050
UnionType::class,
20512051
'literal-string|uppercase-string',
20522052
],
2053+
[
2054+
[
2055+
new IntersectionType([new StringType(), new AccessoryLowercaseStringType()]),
2056+
new IntersectionType([new StringType(), new AccessoryUppercaseStringType()]),
2057+
],
2058+
UnionType::class,
2059+
'lowercase-string|uppercase-string',
2060+
],
20532061
[
20542062
[
20552063
TemplateTypeFactory::create(
@@ -4015,6 +4023,14 @@ public function dataIntersect(): iterable
40154023
IntersectionType::class,
40164024
'literal-string&uppercase-string',
40174025
],
4026+
[
4027+
[
4028+
new IntersectionType([new StringType(), new AccessoryLowercaseStringType()]),
4029+
new IntersectionType([new StringType(), new AccessoryUppercaseStringType()]),
4030+
],
4031+
IntersectionType::class,
4032+
'lowercase-string&uppercase-string',
4033+
],
40184034
];
40194035

40204036
if (PHP_VERSION_ID < 80100) {

0 commit comments

Comments
 (0)