php-parser/test/bootstrap.php
Nikita Popov d8312a09a3 Split parsing tests into code tests and other stuff
And run the other stuff against Php5 and Php7 parsers.

Also move canonicalize() from CodeTestAbstract into a free-standing
function.
2015-06-20 11:44:29 +02:00

17 lines
345 B
PHP

<?php
namespace PhpParser;
require __DIR__ . '/../lib/bootstrap.php';
function canonicalize($str) {
// trim from both sides
$str = trim($str);
// normalize EOL to \n
$str = str_replace(array("\r\n", "\r"), "\n", $str);
// trim right side of all lines
return implode("\n", array_map('rtrim', explode("\n", $str)));
}