mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +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";
|
||||
|
||||
function check($code, $expected) {
|
||||
$shrinked = php_shrink("<?php\n$code");
|
||||
if ("<?php\n" . preg_replace('~([^*]) ~', "\\1\n", $expected) . "" != $shrinked) {
|
||||
$shrinked = str_replace("\n", " ", php_shrink("<?php\n$code"));
|
||||
if ("<?php $expected" != $shrinked) {
|
||||
$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