forked from PHPCSStandards/PHP_CodeSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PHPCSStandards#163 from rodrigoprimo/update-assign…
…ement-in-condition-code-coverage Generic/AssignmentInCondition: improve sniff code coverage
- Loading branch information
Showing
7 changed files
with
70 additions
and
37 deletions.
There are no files selected for viewing
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.2.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,4 @@ | ||
<?php | ||
|
||
// Intentional parse error. Testing that the sniff is *not* triggered in this case. | ||
if ($a == 123 |
4 changes: 4 additions & 0 deletions
4
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.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,4 @@ | ||
<?php | ||
|
||
// Intentional parse error. Testing that the sniff is *not* triggered in this case. | ||
for ($i = 0; $i == 100; $i++ |
6 changes: 6 additions & 0 deletions
6
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.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,6 @@ | ||
<?php | ||
|
||
// Intentional parse error. Testing that the sniff is *not* triggered in this case. | ||
for ($i = 0) { | ||
echo 'foo'; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.5.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. Testing that the sniff is *not* triggered in this case. | ||
for ($i = 0; $i == 100) { | ||
echo 'foo'; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.6.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,5 @@ | ||
<?php | ||
|
||
// Intentional parse error. Testing that the sniff is *not* triggered in this case. | ||
switch ( true ) { | ||
case $sample == 'something' |
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