Skip to content

Commit dc9c345

Browse files
committed
DisallowSpaceIndent: Add additional unit tests for comments
1 parent 90afad4 commit dc9c345

File tree

3 files changed

+103
-19
lines changed

3 files changed

+103
-19
lines changed

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,39 @@ $x = 1;
6868
echo 'And another one.'
6969
echo 'And another one.'
7070
echo 'And another one.'
71+
72+
/*
73+
* This multi-line comment should be fine and should be ignored for metrics.
74+
*/
75+
76+
/*
77+
This multi-line comment should be fine and should be ignored for metrics.
78+
79+
Another line.
80+
*/
81+
82+
/**
83+
* This PHP DocBlock is indented with tabs + one space; metrics should say tabs.
84+
*
85+
* @var int $x
86+
*/
87+
88+
/*
89+
* This multi-line comment is indented with tabs + one space; metrics should say tabs.
90+
*/
91+
92+
/**
93+
* This PHP DocBlock is indented with spaces and should be fixed.
94+
*
95+
* @var int $x
96+
*/
97+
98+
/*
99+
* This multi-line comment is indented with spaces and should be fixed.
100+
*/
101+
102+
/*
103+
This multi-line comment is indented with spaces and should be fixed.
104+
105+
Another line.
106+
*/

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,39 @@ $x = 1;
6868
echo 'And another one.'
6969
echo 'And another one.'
7070
echo 'And another one.'
71+
72+
/*
73+
* This multi-line comment should be fine and should be ignored for metrics.
74+
*/
75+
76+
/*
77+
This multi-line comment should be fine and should be ignored for metrics.
78+
79+
Another line.
80+
*/
81+
82+
/**
83+
* This PHP DocBlock is indented with tabs + one space; metrics should say tabs.
84+
*
85+
* @var int $x
86+
*/
87+
88+
/*
89+
* This multi-line comment is indented with tabs + one space; metrics should say tabs.
90+
*/
91+
92+
/**
93+
* This PHP DocBlock is indented with spaces and should be fixed.
94+
*
95+
* @var int $x
96+
*/
97+
98+
/*
99+
* This multi-line comment is indented with spaces and should be fixed.
100+
*/
101+
102+
/*
103+
This multi-line comment is indented with spaces and should be fixed.
104+
105+
Another line.
106+
*/

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

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,37 @@ public function getErrorList($testFile='DisallowSpaceIndentUnitTest.inc')
3030
switch ($testFile) {
3131
case 'DisallowSpaceIndentUnitTest.inc':
3232
return array(
33-
5 => 1,
34-
9 => 1,
35-
15 => 1,
36-
22 => 1,
37-
24 => 1,
38-
30 => 1,
39-
35 => 1,
40-
50 => 1,
41-
55 => 1,
42-
57 => 1,
43-
58 => 1,
44-
59 => 1,
45-
60 => 1,
46-
65 => 1,
47-
66 => 1,
48-
67 => 1,
49-
68 => 1,
50-
69 => 1,
51-
70 => 1,
33+
5 => 1,
34+
9 => 1,
35+
15 => 1,
36+
22 => 1,
37+
24 => 1,
38+
30 => 1,
39+
35 => 1,
40+
50 => 1,
41+
55 => 1,
42+
57 => 1,
43+
58 => 1,
44+
59 => 1,
45+
60 => 1,
46+
65 => 1,
47+
66 => 1,
48+
67 => 1,
49+
68 => 1,
50+
69 => 1,
51+
70 => 1,
52+
92 => 1,
53+
93 => 1,
54+
94 => 1,
55+
95 => 1,
56+
96 => 1,
57+
98 => 1,
58+
99 => 1,
59+
100 => 1,
60+
102 => 1,
61+
103 => 1,
62+
105 => 1,
63+
106 => 1,
5264
);
5365
break;
5466
case 'DisallowSpaceIndentUnitTest.js':

0 commit comments

Comments
 (0)