diff --git a/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc similarity index 84% rename from src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc rename to src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc index 505cb6e40c..1847778d09 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc +++ b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc @@ -2,32 +2,42 @@ echo $blah; echo $blah; echo($blah); +echo$blah; print $blah; print $blah; print($blah); +print$blah; include $blah; include $blah; include($blah); +include$blah; include_once $blah; include_once $blah; include_once($blah); +include_once$blah; require $blah; require $blah; require($blah); +require$blah; require_once $blah; require_once $blah; require_once($blah); +require_once$blah; $obj = new MyClass(); $obj = new MyClass(); +$obj = new $className(); +$obj = new$className(); + yield $blah; yield $blah; +yield$blah; yield from $test(); yield FROM $test(); @@ -39,12 +49,16 @@ yield From $test(); +yield FROM$test(); throw new Exception(); throw new Exception(); throw new Exception(); throw new Exception(); +throw $exception; +throw$exception; + namespace MyClass; namespace MyClass; namespace MyNamespace\MyClass; @@ -66,6 +80,7 @@ return; return $blah; return $blah; return($blah); +return$blah; return $tab; return @@ -74,6 +89,3 @@ $newLine; // The following line must have a single space at the end (after return) return $spaceAndNewLine; - -// The following line must be the last line in the file -return diff --git a/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc.fixed b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed similarity index 83% rename from src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc.fixed rename to src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed index 9934030bbe..4f5d3cec2f 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed @@ -2,30 +2,40 @@ echo $blah; echo $blah; echo($blah); +echo $blah; print $blah; print $blah; print($blah); +print $blah; include $blah; include $blah; include($blah); +include $blah; include_once $blah; include_once $blah; include_once($blah); +include_once $blah; require $blah; require $blah; require($blah); +require $blah; require_once $blah; require_once $blah; require_once($blah); +require_once $blah; $obj = new MyClass(); $obj = new MyClass(); +$obj = new $className(); +$obj = new $className(); + +yield $blah; yield $blah; yield $blah; @@ -35,12 +45,16 @@ YIELD from $test(); yield from $test(); yield from $test(); yield From $test(); +yield FROM $test(); throw new Exception(); throw new Exception(); throw new Exception(); throw new Exception(); +throw $exception; +throw $exception; + namespace MyClass; namespace MyClass; namespace MyNamespace\MyClass; @@ -62,12 +76,10 @@ return; return $blah; return $blah; return($blah); +return $blah; return $tab; return $newLine; // The following line must have a single space at the end (after return) return $spaceAndNewLine; - -// The following line must be the last line in the file -return diff --git a/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.2.inc b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.2.inc new file mode 100644 index 0000000000..5c9325fcaa --- /dev/null +++ b/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.2.inc @@ -0,0 +1,4 @@ + */ - public function getErrorList() + public function getErrorList($testFile='') { - return [ - 3 => 1, - 7 => 1, - 11 => 1, - 15 => 1, - 19 => 1, - 23 => 1, - 27 => 1, - 30 => 1, - 33 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 38 => 1, - 44 => 1, - 45 => 1, - 46 => 2, - 49 => 1, - 51 => 1, - 59 => 1, - 61 => 1, - 63 => 1, - 67 => 1, - 70 => 1, - 71 => 1, - 75 => 1, - ]; + switch ($testFile) { + case 'LanguageConstructSpacingUnitTest.1.inc': + return [ + 3 => 1, + 5 => 1, + 8 => 1, + 10 => 1, + 13 => 1, + 15 => 1, + 18 => 1, + 20 => 1, + 23 => 1, + 25 => 1, + 28 => 1, + 30 => 1, + 33 => 1, + 36 => 1, + 39 => 1, + 40 => 1, + 43 => 1, + 44 => 1, + 45 => 1, + 46 => 1, + 48 => 1, + 52 => 1, + 55 => 1, + 56 => 1, + 57 => 2, + 60 => 1, + 63 => 1, + 65 => 1, + 73 => 1, + 75 => 1, + 77 => 1, + 81 => 1, + 83 => 1, + 85 => 1, + 86 => 1, + 90 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList()