Skip to content

Commit 3d55d71

Browse files
authored
Merge pull request #541 from biinari/chore/143-Squiz_CSS_ShorthandSize_separate_parse_error
Squiz/CSS/ShorthandSize: move parse error test to its own file
2 parents d0a9809 + 2ea2cb3 commit 3d55d71

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css renamed to src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,3 @@
3939
2px /* phpcs:disable Standard.Category.SniffName -- for reasons */
4040
4px;
4141
}
42-
43-
/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */
44-
#live-coding {
45-
margin: 8px 8px 8px 8px

src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.css.fixed renamed to src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,3 @@
3535
2px /* phpcs:disable Standard.Category.SniffName -- for reasons */
3636
4px;
3737
}
38-
39-
/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */
40-
#live-coding {
41-
margin: 8px 8px 8px 8px
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Intentional parse error. Live coding resilience. */
2+
#live-coding {
3+
margin: 8px 8px 8px 8px

src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,30 @@ final class ShorthandSizeUnitTest extends AbstractSniffUnitTest
2626
* The key of the array should represent the line number and the value
2727
* should represent the number of errors that should occur on that line.
2828
*
29+
* @param string $testFile The name of the file being tested.
30+
*
2931
* @return array<int, int>
3032
*/
31-
public function getErrorList()
33+
public function getErrorList($testFile='')
3234
{
33-
return [
34-
8 => 1,
35-
9 => 1,
36-
10 => 1,
37-
11 => 1,
38-
12 => 1,
39-
13 => 1,
40-
15 => 1,
41-
16 => 1,
42-
17 => 1,
43-
21 => 1,
44-
];
35+
switch ($testFile) {
36+
case 'ShorthandSizeUnitTest.1.css':
37+
return [
38+
8 => 1,
39+
9 => 1,
40+
10 => 1,
41+
11 => 1,
42+
12 => 1,
43+
13 => 1,
44+
15 => 1,
45+
16 => 1,
46+
17 => 1,
47+
21 => 1,
48+
];
49+
50+
default:
51+
return [];
52+
}//end switch
4553

4654
}//end getErrorList()
4755

0 commit comments

Comments
 (0)