Skip to content

Commit 9a37023

Browse files
committed
Add more test cases
1 parent ade7898 commit 9a37023

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/PHPStan/Analyser/data/equal.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ public function doIpsum(array $a): void
6767

6868
public function stdClass(\stdClass $a, \stdClass $b): void
6969
{
70+
if ($a == $a) {
71+
assertType('stdClass', $a);
72+
} else {
73+
assertType('*NEVER*', $a);
74+
}
75+
76+
if ($b != $b) {
77+
assertType('*NEVER*', $b);
78+
} else {
79+
assertType('stdClass', $b);
80+
}
81+
7082
if ($a == $b) {
7183
assertType('stdClass', $a);
7284
assertType('stdClass', $b);

tests/PHPStan/Analyser/data/identical.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ public function foo(\stdClass $a, \stdClass $b): void
2121
assertType('stdClass', $b);
2222
}
2323

24+
if ($a === $b) {
25+
assertType('stdClass', $a);
26+
assertType('stdClass', $b);
27+
} else {
28+
assertType('stdClass', $a);
29+
assertType('stdClass', $b);
30+
}
31+
32+
if ($a !== $b) {
33+
assertType('stdClass', $a);
34+
assertType('stdClass', $b);
35+
} else {
36+
assertType('stdClass', $a);
37+
assertType('stdClass', $b);
38+
}
39+
2440
assertType('stdClass', $a);
2541
assertType('stdClass', $b);
2642
}

0 commit comments

Comments
 (0)