From 4bb5c38eb609907d024553131f50fd9e2bb8f1a7 Mon Sep 17 00:00:00 2001 From: hirokinoue <70567194+hirokinoue@users.noreply.github.com> Date: Fri, 29 Apr 2022 00:52:37 +0900 Subject: [PATCH] add test case for usort() --- tests/ArrayFunctionCallTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/ArrayFunctionCallTest.php b/tests/ArrayFunctionCallTest.php index 69bcf140b2c..8ab3396a6de 100644 --- a/tests/ArrayFunctionCallTest.php +++ b/tests/ArrayFunctionCallTest.php @@ -1809,10 +1809,14 @@ function getCharPairs(string $line) : array { ], 'usort' => [ ' $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', + '$array' => 'non-empty-list', + '$emptyArray' => 'list', ], ], 'closureParamConstraintsMet' => [