Skip to content

Commit 88ff4f1

Browse files
committed
Generic/OpeningBraceSameLine: improve code coverage
This commit improves the test code coverage for the Generic.Classes.OpeningBraceSameLine sniff. There was one line that was not exercised by tests that handle cases where the opening and closing brace for the class are on the same line as the class name.
1 parent be32eca commit 88ff4f1

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ class Test_Class_Bad_G
9393
enum Test_Enum
9494
{
9595
}
96+
97+
class Test_Class_Good_D {}
98+
99+
class Test_Class_Bad_H
100+
{}

src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc.fixed

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ class Test_Class_Bad_G
9393
enum Test_Enum {
9494

9595
}
96+
97+
class Test_Class_Good_D {}
98+
99+
class Test_Class_Bad_H {
100+
}

src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ public function getErrorList()
3232
{
3333

3434
return [
35-
19 => 2,
36-
23 => 1,
37-
28 => 2,
38-
34 => 1,
39-
38 => 1,
40-
41 => 1,
41-
44 => 1,
42-
47 => 1,
43-
70 => 1,
44-
79 => 1,
45-
90 => 1,
46-
94 => 1,
35+
19 => 2,
36+
23 => 1,
37+
28 => 2,
38+
34 => 1,
39+
38 => 1,
40+
41 => 1,
41+
44 => 1,
42+
47 => 1,
43+
70 => 1,
44+
79 => 1,
45+
90 => 1,
46+
94 => 1,
47+
100 => 1,
4748
];
4849

4950
}//end getErrorList()

0 commit comments

Comments
 (0)