Skip to content

Squiz/CSS/ShorthandSize: move parse error test to its own file #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@
2px /* phpcs:disable Standard.Category.SniffName -- for reasons */
4px;
}

/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */
#live-coding {
margin: 8px 8px 8px 8px
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@
2px /* phpcs:disable Standard.Category.SniffName -- for reasons */
4px;
}

/* Intentional parse error. Live coding resilience. This has to be the last test in the file. */
#live-coding {
margin: 8px 8px 8px 8px
3 changes: 3 additions & 0 deletions src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* Intentional parse error. Live coding resilience. */
#live-coding {
margin: 8px 8px 8px 8px
34 changes: 21 additions & 13 deletions src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,30 @@ final class ShorthandSizeUnitTest extends AbstractSniffUnitTest
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int>
*/
public function getErrorList()
public function getErrorList($testFile='')
{
return [
8 => 1,
9 => 1,
10 => 1,
11 => 1,
12 => 1,
13 => 1,
15 => 1,
16 => 1,
17 => 1,
21 => 1,
];
switch ($testFile) {
case 'ShorthandSizeUnitTest.1.css':
return [
8 => 1,
9 => 1,
10 => 1,
11 => 1,
12 => 1,
13 => 1,
15 => 1,
16 => 1,
17 => 1,
21 => 1,
];

default:
return [];
}//end switch

}//end getErrorList()

Expand Down