diff --git a/test/PhpParser/CodeParsingTest.php b/test/PhpParser/CodeParsingTest.php index 3bdab81..459996c 100644 --- a/test/PhpParser/CodeParsingTest.php +++ b/test/PhpParser/CodeParsingTest.php @@ -52,7 +52,8 @@ class CodeParsingTest extends CodeTestAbstract ]; } - private function getParseOutput(Parser $parser, $code, array $modes) { + // Must be public for updateTests.php + public function getParseOutput(Parser $parser, $code, array $modes) { $dumpPositions = isset($modes['positions']); $errors = new ErrorHandler\Collecting; diff --git a/test/updateTests.php b/test/updateTests.php index d4de79c..40d0d0a 100644 --- a/test/updateTests.php +++ b/test/updateTests.php @@ -21,7 +21,7 @@ foreach (filesInDir($dir, 'test') as $fileName => $code) { foreach ($tests as list($modeLine, list($input, $expected))) { $modes = null !== $modeLine ? array_fill_keys(explode(',', $modeLine), true) : []; list($parser5, $parser7) = $codeParsingTest->createParsers($modes); - $output = isset($modes['php5']) + list(, $output) = isset($modes['php5']) ? $codeParsingTest->getParseOutput($parser5, $input, $modes) : $codeParsingTest->getParseOutput($parser7, $input, $modes); $newTests[] = [$modeLine, [$input, $output]];