Skip to content

Commit

Permalink
add test case for usort()
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokinoue committed Apr 28, 2022
1 parent 2b34b12 commit 4bb5c38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/ArrayFunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1809,10 +1809,14 @@ function getCharPairs(string $line) : array {
],
'usort' => [
'<?php
function baz (int $a, int $b): int { return $a <=> $b; }
$array = ["foo" => 123, "bar" => 456];
usort($array, function (int $a, int $b) { return $a <=> $b; });',
usort($array, "baz");
$emptyArray = [];
usort($emptyArray, "baz");',
'assertions' => [
'$array' => 'list<int>',
'$array' => 'non-empty-list<int>',
'$emptyArray' => 'list<empty>',
],
],
'closureParamConstraintsMet' => [
Expand Down

0 comments on commit 4bb5c38

Please sign in to comment.