Skip to content

Commit 4607a26

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/IncrementDecrementSpacing: improve test coverage
Adds tests using pre/post-incrementors with an object property accessed through a method call.
1 parent a30addb commit 4607a26

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ $obj->prop['key'] ++;
3838

3939
getObject()->count
4040
++;
41+
getObject()->count++;
42+
++ getObject()->count;
43+
++getObject()->count;

src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ $obj->prop['key']++;
3636
--ClassName::$prop;
3737

3838
getObject()->count++;
39+
getObject()->count++;
40+
++getObject()->count;
41+
++getObject()->count;

src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function getErrorList($testFile='')
5454
$errors[34] = 1;
5555
$errors[37] = 1;
5656
$errors[40] = 1;
57+
$errors[42] = 1;
5758

5859
return $errors;
5960

0 commit comments

Comments
 (0)