Skip to content

Commit

Permalink
added failling TypeCombinatorTests
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab authored and staabm committed Jul 25, 2022
1 parent a1f7bf0 commit 30728d4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/PHPStan/Type/TypeCombinatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPStan\Fixture\FinalClass;
use PHPStan\Testing\PHPStanTestCase;
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
use PHPStan\Type\Accessory\AccessoryNonFalsyStringType;
use PHPStan\Type\Accessory\AccessoryNumericStringType;
use PHPStan\Type\Accessory\HasMethodType;
use PHPStan\Type\Accessory\HasOffsetType;
Expand Down Expand Up @@ -1905,6 +1906,28 @@ public function dataUnion(): iterable
StringType::class,
'string',
],
[
[
new ConstantStringType('0'),
new IntersectionType([
new StringType(),
new AccessoryNonFalsyStringType(),
]),
],
IntersectionType::class,
'non-empty-string',
],
[
[
new ConstantStringType(''),
new IntersectionType([
new StringType(),
new AccessoryNonFalsyStringType(),
]),
],
StringType::class,
'string',
],
[
[
new StringType(),
Expand Down

0 comments on commit 30728d4

Please sign in to comment.