Skip to content

Commit

Permalink
add tests for null error case
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Mar 16, 2024
1 parent 83b6c98 commit bb40f12
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/BinaryOperationTest.php
Expand Up @@ -1327,6 +1327,22 @@ function foo(string $s1, string $s2): string {
}',
'error_message' => 'PossiblyInvalidOperand',
],
'greaterEqualIntNull' => [
'code' => '<?php
$a = $a = rand(0, 1) > 0 ? rand(0) : null;
if ($a >= 0) {
echo "can be null";
}',
'error_message' => 'PossiblyInvalidOperand',
],
'smallerIntNull' => [
'code' => '<?php
$a = $a = rand(0, 1) > 0 ? rand(0) : null;
if ($a < rand(0)) {
echo "can be null";
}',
'error_message' => 'PossiblyInvalidOperand',
],
];
}
}

0 comments on commit bb40f12

Please sign in to comment.