From 22486ec56dc5336d2af4fac5c00dc2caeb41df7c Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Fri, 28 Aug 2026 20:35:43 +0800 Subject: [PATCH] test: cover invalid multi-level loop control --- phpunit/src/NegativeCompatibilityTest.php | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/phpunit/src/NegativeCompatibilityTest.php b/phpunit/src/NegativeCompatibilityTest.php index 6a69a1b5..35be9337 100644 --- a/phpunit/src/NegativeCompatibilityTest.php +++ b/phpunit/src/NegativeCompatibilityTest.php @@ -145,6 +145,62 @@ function main(): void PHP, ]; + yield 'break level exceeds enclosing depth' => [ + 'convert', + "Cannot 'break' 2 levels", + <<<'PHP' + [ + 'convert', + "Cannot 'continue' 2 levels", + <<<'PHP' + [ + 'convert', + "'break' operator accepts only positive integer literals", + <<<'PHP' + [ + 'convert', + "'continue' operator accepts only positive integer literals", + <<<'PHP' + [ 'prepare', 'Cannot use Webman\\Route\\Route as Route because the name is already in use',