Skip to content

Commit 6ba6a91

Browse files
committed
Generic/IncrementDecrementSpacing: improve test coverage
Adds tests for for using pre/post-incrementors with an object property accessed through a method call. Including one test with a newline between the object property accessed through a method call and a post-increment operator to test a fix in a previous commit.
1 parent a4de5b1 commit 6ba6a91

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

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

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

3636
--ClassName::$prop;
3737
-- ClassName::$prop;
38+
39+
++getObject()->count;
40+
++ getObject()->count;
41+
getObject()->count++;
42+
getObject()->count
43+
++;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ $obj->prop['key']++;
3434

3535
--ClassName::$prop;
3636
--ClassName::$prop;
37+
38+
++getObject()->count;
39+
++getObject()->count;
40+
getObject()->count++;
41+
getObject()->count++;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function getErrorList($testFile='')
5353
$errors[31] = 1;
5454
$errors[34] = 1;
5555
$errors[37] = 1;
56+
$errors[40] = 1;
57+
$errors[43] = 1;
5658

5759
return $errors;
5860

0 commit comments

Comments
 (0)