From cde9ed2b587a8e0e46906e21e18363248ff5a6c0 Mon Sep 17 00:00:00 2001 From: hafung <32428762+hafung@users.noreply.github.com> Date: Fri, 4 Sep 2026 11:58:04 +0800 Subject: [PATCH] test(stdlib): cover RoundingMode enum at runtime (#78) --skip-tests --- tests/compiler/stdlib/round-mode.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/compiler/stdlib/round-mode.phpt b/tests/compiler/stdlib/round-mode.phpt index 13d4bb44..35a7dee8 100644 --- a/tests/compiler/stdlib/round-mode.phpt +++ b/tests/compiler/stdlib/round-mode.phpt @@ -7,6 +7,7 @@ function main() // A valid legacy mode still produces PHP's result. var_dump(round(2.5, 0, PHP_ROUND_HALF_DOWN)); var_dump(round(3.5, 0, PHP_ROUND_HALF_ODD)); + var_dump(round(2.5, 0, RoundingMode::HalfEven)); // An out-of-range integer mode must raise ValueError. The Native wrapper // calls _php_math_round() directly, where the same value aborts the @@ -47,6 +48,7 @@ function main() --EXPECT-- float(2) float(3) +float(2) caught=round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) caught=round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) caught=round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*)