Skip to content
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

Squiz/ObjectInstantiation: move parse error test to its own file #543

Closed
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 @@ -47,7 +47,3 @@ $a = $b !== null
default => 5,
}
: new Foo;

// Intentional parse error. This must be the last test in the file.
function new
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// Intentional parse error. Live coding resilience.
function new
22 changes: 15 additions & 7 deletions src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,24 @@ final class ObjectInstantiationUnitTest 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 [
5 => 1,
8 => 1,
31 => 1,
39 => 2,
];
switch ($testFile) {
case 'ObjectInstantiationUnitTest.1.inc':
return [
5 => 1,
8 => 1,
31 => 1,
39 => 2,
];

default:
return [];
}//end switch

}//end getErrorList()

Expand Down