Skip to content

Commit 1fad6ab

Browse files
committed
Improve test coverage for the AssignmentInCondition sniff
This commit improves the test coverage for the AssignmentInCondition sniff by adding a few more test case files to exercise the parts of the sniff code that checks for invalid syntax.
1 parent dce2307 commit 1fad6ab

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
// Intentional parse error. Testing that the sniff is *not* triggered in this case.
4+
if ($a == 123
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
// Intentional parse error. Testing that the sniff is *not* triggered in this case.
4+
for ($i = 0; $i == 100; $i++
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
// Intentional parse error. Testing that the sniff is *not* triggered in this case.
4+
for ($i = 0) {
5+
echo 'foo';
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
// Intentional parse error. Testing that the sniff is *not* triggered in this case.
4+
for ($i = 0; $i == 100) {
5+
echo 'foo';
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
// Intentional parse error. Testing that the sniff is *not* triggered in this case.
4+
switch ( true ) {
5+
case $sample == 'something'

0 commit comments

Comments
 (0)