Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm authored and ondrejmirtes committed Mar 3, 2022
1 parent 58215cb commit a84465b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/PHPStan/Analyser/data/equal.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public function doIpsum(array $a): void

public function stdClass(\stdClass $a, \stdClass $b): void
{
if ($a == $a) {
assertType('stdClass', $a);
} else {
assertType('*NEVER*', $a);
}

if ($b != $b) {
assertType('*NEVER*', $b);
} else {
assertType('stdClass', $b);
}

if ($a == $b) {
assertType('stdClass', $a);
assertType('stdClass', $b);
Expand Down
16 changes: 16 additions & 0 deletions tests/PHPStan/Analyser/data/identical.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ public function foo(\stdClass $a, \stdClass $b): void
assertType('stdClass', $b);
}

if ($a === $b) {
assertType('stdClass', $a);
assertType('stdClass', $b);
} else {
assertType('stdClass', $a);
assertType('stdClass', $b);
}

if ($a !== $b) {
assertType('stdClass', $a);
assertType('stdClass', $b);
} else {
assertType('stdClass', $a);
assertType('stdClass', $b);
}

assertType('stdClass', $a);
assertType('stdClass', $b);
}
Expand Down

0 comments on commit a84465b

Please sign in to comment.