diff --git a/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc new file mode 100644 index 0000000000..d1863c0763 --- /dev/null +++ b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc @@ -0,0 +1,12 @@ +foo. +Now, I am printing some {$foo->bar[1]}. +This should not print a capital 'A': \x41 +EOT; diff --git a/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc similarity index 58% rename from src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc rename to src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc index 56f4393aed..eb0062f08e 100644 --- a/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc +++ b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc @@ -1,16 +1,6 @@ foo. -Now, I am printing some {$foo->bar[1]}. -This should not print a capital 'A': \x41 -EOT; +// Intentional parse error. // The following function has a simulated git conflict for testing. // This is not a merge conflict - it is a valid test case. // Please do not remove. diff --git a/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php index 90f4cfab66..de2d71e48e 100644 --- a/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php @@ -26,14 +26,22 @@ class HeredocUnitTest 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 */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 2 => 1, - 8 => 1, - ]; + switch ($testFile) { + case 'HeredocUnitTest.1.inc': + return [ + 2 => 1, + 8 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList()