Skip to content

Commit 969b9d8

Browse files
committed
add test for continue
1 parent 9ee7171 commit 969b9d8

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ lint:
3838
--exclude tests/PHPStan/Levels/data/namedArguments.php \
3939
--exclude tests/PHPStan/Rules/Keywords/data/continue-break.php \
4040
--exclude tests/PHPStan/Rules/Keywords/data/continue-break-property-hook.php \
41-
--exclude tests/PHPStan/Rules/Keywords/data/bug-13790.php \
41+
--exclude tests/PHPStan/Rules/Keywords/data/bug-13790-break.php \
42+
--exclude tests/PHPStan/Rules/Keywords/data/bug-13790-continue.php \
4243
--exclude tests/PHPStan/Rules/Properties/data/invalid-callable-property-type.php \
4344
--exclude tests/PHPStan/Rules/Properties/data/properties-in-interface.php \
4445
--exclude tests/PHPStan/Rules/Properties/data/read-only-property.php \

tests/PHPStan/Rules/Keywords/ContinueBreakInLoopRuleTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,22 @@ public function testPropertyHooks(): void
7676

7777
public function testBug13790(): void
7878
{
79-
$this->analyse([__DIR__ . '/data/bug-13790.php'], [
79+
$this->analyse(
8080
[
81-
'Keyword break used outside of a loop or a switch statement.',
82-
2,
81+
__DIR__ . '/data/bug-13790-break.php',
82+
__DIR__ . '/data/bug-13790-continue.php',
8383
],
84-
]);
84+
[
85+
[
86+
'Keyword break used outside of a loop or a switch statement.',
87+
2,
88+
],
89+
[
90+
'Keyword continue used outside of a loop or a switch statement.',
91+
2,
92+
],
93+
],
94+
);
8595
}
8696

8797
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
continue;

0 commit comments

Comments
 (0)