Skip to content

Commit

Permalink
add test case for uasort()
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokinoue committed Apr 28, 2022
1 parent 37bf36d commit d4470cc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/ArrayFunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,15 +666,23 @@ function foo(array $arr) {
],
'uasort' => [
'<?php
function foo (int $a, int $b): int {
return $a > $b ? 1 : -1;
}
$manifest = ["a" => 1, "b" => 2];
uasort(
$manifest,
function (int $a, int $b) {
return $a > $b ? 1 : -1;
}
);',
"foo"
);
$emptyManifest = [];
uasort(
$emptyManifest,
"foo"
);
',
'assertions' => [
'$manifest' => 'array<string, int>'
'$manifest' => 'non-empty-array<string, int>',
'$emptyManifest' => 'array<empty, empty>',
],
],
'uksort' => [
Expand Down

0 comments on commit d4470cc

Please sign in to comment.