X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fnikic%2Fphp-parser%2Ftest%2FupdateTests.php;fp=vendor%2Fnikic%2Fphp-parser%2Ftest%2FupdateTests.php;h=d4de79c185332d6b37ec9388f63c22f51918102e;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/nikic/php-parser/test/updateTests.php b/vendor/nikic/php-parser/test/updateTests.php new file mode 100644 index 000000000..d4de79c18 --- /dev/null +++ b/vendor/nikic/php-parser/test/updateTests.php @@ -0,0 +1,32 @@ + $code) { + if (false !== strpos($code, '@@{')) { + // Skip tests with evaluate segments + continue; + } + + list($name, $tests) = $testParser->parseTest($code, 2); + $newTests = []; + 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']) + ? $codeParsingTest->getParseOutput($parser5, $input, $modes) + : $codeParsingTest->getParseOutput($parser7, $input, $modes); + $newTests[] = [$modeLine, [$input, $output]]; + } + + $newCode = $testParser->reconstructTest($name, $newTests); + file_put_contents($fileName, $newCode); +}