-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/InlineControlStructure: improve code coverage
- Loading branch information
1 parent
1c3e52f
commit 62637ca
Showing
7 changed files
with
77 additions
and
2 deletions.
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
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
9 changes: 9 additions & 0 deletions
9
src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.10.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,9 @@ | ||
<?php | ||
|
||
// This should be the only test in this file. | ||
// There should be only empty tokens after the scope closer of the "if" token. | ||
|
||
for ($i = 0; $i < 5; $i++) | ||
if ($i === 3) { | ||
echo $i; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.10.inc.fixed
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,10 @@ | ||
<?php | ||
|
||
// This should be the only test in this file. | ||
// There should be only empty tokens after the scope closer of the "if" token. | ||
|
||
for ($i = 0; $i < 5; $i++) { | ||
if ($i === 3) { | ||
echo $i; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.8.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,7 @@ | ||
<?php | ||
|
||
// Intentional parse error (nothing after for closing parenthesis). | ||
// This should be the only test in this file. | ||
// Testing that the sniff is *not* triggered. | ||
|
||
for ($i = 0; $i < 5; $i++) |
7 changes: 7 additions & 0 deletions
7
src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.9.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,7 @@ | ||
<?php | ||
|
||
// Intentional parse error (nothing after while closing parenthesis). | ||
// This should be the only test in this file. | ||
// Testing that the sniff is *not* triggered. | ||
|
||
while ($i < 5) |
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