Fix updateTests.php

This commit is contained in:
Nikita Popov 2018-07-22 15:19:40 +02:00
parent 2f67429ec9
commit 3e02eb7108
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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]];