mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 15:16:44 +02:00
php_shrink: Simplify test
This commit is contained in:
@@ -3,10 +3,10 @@ include __DIR__ . "/../adminer/include/errors.inc.php";
|
|||||||
include __DIR__ . "/../php_shrink.inc.php";
|
include __DIR__ . "/../php_shrink.inc.php";
|
||||||
|
|
||||||
function check($code, $expected) {
|
function check($code, $expected) {
|
||||||
$shrinked = php_shrink("<?php\n$code");
|
$shrinked = str_replace("\n", " ", php_shrink("<?php\n$code"));
|
||||||
if ("<?php\n" . preg_replace('~([^*]) ~', "\\1\n", $expected) . "" != $shrinked) {
|
if ("<?php $expected" != $shrinked) {
|
||||||
$backtrace = reset(debug_backtrace());
|
$backtrace = reset(debug_backtrace());
|
||||||
echo "$backtrace[file]:$backtrace[line]:" . str_replace("\n", " ", substr($shrinked, 6)) . "\n";
|
echo "$backtrace[file]:$backtrace[line]:" . substr($shrinked, 6) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user