Skip to content

Commit e31dd72

Browse files
committed
more tests
1 parent 3e8ce45 commit e31dd72

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-5051.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,39 @@ public function testWithBooleans($data): void
6262
assertType('1|2|3|10', $data);
6363
assertType('bool', $update);
6464
}
65+
66+
if ($data === 1) {
67+
assertType('bool', $update);
68+
assertType('bool', $foo);
69+
} else {
70+
assertType('bool', $update);
71+
assertType('bool', $foo);
72+
}
73+
74+
if ($data === 2) {
75+
assertType('bool', $update);
76+
assertType('bool', $foo);
77+
} else {
78+
assertType('bool', $update);
79+
assertType('bool', $foo);
80+
}
81+
82+
if ($data === 3) {
83+
assertType('bool', $update);
84+
assertType('bool', $foo);
85+
} else {
86+
assertType('bool', $update);
87+
assertType('bool', $foo);
88+
}
89+
90+
if ($data === 1 || $data === 2) {
91+
assertType('bool', $update);
92+
assertType('bool', $foo);
93+
} else {
94+
assertType('bool', $update);
95+
assertType('bool', $foo);
96+
}
97+
6598
}
6699

67100
public function testWithDifferentVariableNames(?object $data): void

0 commit comments

Comments
 (0)