-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/JumbledIncrementer: improve test coverage
This commit adds tests for: - for alternative syntax - for loops missing one or more condition parts - sniff bails early when it encounters a parse error (missing for body and inner for loop missing opening parenthesis - for loops with more than one incrementer - for loops with decrementers
- Loading branch information
1 parent
5e59b86
commit 257630b
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.3.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
// Intentional parse error (missing for body). | ||
// This should be the only test in this file. | ||
// Testing that the sniff is *not* triggered. | ||
for |
8 changes: 8 additions & 0 deletions
8
src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.4.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
// Intentional parse error (inner for loop missing opening parenthesis). | ||
// This should be the only test in this file. | ||
// Testing that the sniff is *not* triggered. | ||
for ($i = 0; $i < 20; $i++) { | ||
for | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters