Skip to content

Commit

Permalink
add test case for uksort()
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokinoue committed Apr 28, 2022
1 parent 8c64bdd commit 139948e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/ArrayFunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,15 +687,22 @@ function foo (int $a, int $b): int {
],
'uksort' => [
'<?php
function foo (string $a, string $b): int {
return $a <=> $b;
}
$array = ["b" => 1, "a" => 2];
uksort(
$array,
function (string $a, string $b) {
return $a <=> $b;
}
"foo"
);
$emptyArray = [];
uksort(
$emptyArray,
"foo"
);',
'assertions' => [
'$array' => 'array<string, int>',
'$array' => 'non-empty-array<string, int>',
'$emptyArray' => 'array<empty, empty>',
],
],
'arrayMergeTKeyedArray' => [
Expand Down

0 comments on commit 139948e

Please sign in to comment.