Skip to content

Commit 3ec1bd6

Browse files
committed
FIXUP fixed tests
1 parent ed08155 commit 3ec1bd6

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tests/PHPStan/Analyser/TypeSpecifierTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ public function dataCondition(): iterable
477477
new Variable('foo'),
478478
new Expr\ConstFetch(new Name('null')),
479479
),
480-
['$foo' => self::SURE_NOT_TRUTHY],
481-
['$foo' => self::SURE_NOT_FALSEY],
480+
['$foo' => '0|0.0|\'\'|array{}|false|null'],
481+
['$foo' => '~0|0.0|\'\'|array{}|false|null'],
482482
],
483483
[
484484
new Expr\BinaryOp\Identical(

tests/PHPStan/Analyser/nsrt/equal-narrow.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function doNull($x, $y, $z): void
3737
if ($z == null) {
3838
assertType("0|0.0|''|array{}|false|null", $z);
3939
} else {
40-
assertType("mixed~0|0.0|''|array{}|false|null", $z);
40+
assertType("mixed~(0|0.0|''|array{}|false|null)", $z);
4141
}
4242
}
4343

@@ -74,7 +74,7 @@ function doFalse($x, $y, $z): void
7474
if ($z == false) {
7575
assertType("0|0.0|''|'0'|array{}|false|null", $z);
7676
} else {
77-
assertType("mixed~0|0.0|''|'0'|array{}|false|null", $z);
77+
assertType("mixed~(0|0.0|''|'0'|array{}|false|null)", $z);
7878
}
7979
}
8080

@@ -109,7 +109,7 @@ function doTrue($x, $y, $z): void
109109
}
110110

111111
if ($z == true) {
112-
assertType("mixed~0|0.0|''|'0'|array{}|false|null", $z);
112+
assertType("mixed~(0|0.0|''|'0'|array{}|false|null)", $z);
113113
} else {
114114
assertType("0|0.0|''|'0'|array{}|false|null", $z);
115115
}
@@ -143,6 +143,6 @@ function doEmptyString($x, $y, $z): void
143143
if ($z == '') {
144144
assertType("0|0.0|''|false|null", $z);
145145
} else {
146-
assertType("mixed~''|false|null", $z);
146+
assertType("mixed~(''|false|null)", $z);
147147
}
148148
}

tests/PHPStan/Analyser/nsrt/narrow-cast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function castString($x, string $s, bool $b) {
3333
if ((string) $x) {
3434
assertType('int<-5, 5>', $x);
3535
} else {
36-
assertType('int<-5, 5>', $x);
36+
assertType('0', $x);
3737
}
3838

3939
if ((string) $b) {

tests/PHPStan/Analyser/nsrt/non-empty-string.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ function subtract($m) {
422422
assertType('non-falsy-string', (string) $m);
423423
}
424424
if ($m != '') {
425-
assertType("mixed", $m);
426-
assertType('string', (string) $m);
425+
assertType("mixed~(''|false|null)", $m);
426+
assertType('non-empty-string', (string) $m);
427427
}
428428
if ($m !== '') {
429429
assertType("mixed~''", $m);

0 commit comments

Comments
 (0)