mirror of
https://github.com/php/php-src.git
synced 2026-03-25 16:52:18 +01:00
Multiple tests had to be changed to escape the arguments in shell commands. Some tests are skipped because they behave differently with spaces in the path versus without. One notable example of this is the hashbang test which does not work because spaces in hashbangs paths are not supported in Linux. Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
60 lines
821 B
PHP
60 lines
821 B
PHP
--TEST--
|
|
syntax check
|
|
--SKIPIF--
|
|
<?php include "skipif.inc"; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
|
|
|
|
$filename = __DIR__."/011.test.php";
|
|
$filename_escaped = escapeshellarg($filename);
|
|
|
|
$code = '
|
|
<?php
|
|
|
|
$test = "var";
|
|
|
|
class test {
|
|
private $var;
|
|
}
|
|
|
|
echo test::$var;
|
|
|
|
?>
|
|
';
|
|
|
|
file_put_contents($filename, $code);
|
|
|
|
var_dump(`$php -n -l $filename_escaped`);
|
|
var_dump(`$php -n -l some.unknown`);
|
|
|
|
$code = '
|
|
<?php
|
|
|
|
class test
|
|
private $var;
|
|
}
|
|
|
|
?>
|
|
';
|
|
|
|
file_put_contents($filename, $code);
|
|
|
|
var_dump(`$php -n -l $filename_escaped`);
|
|
|
|
@unlink($filename);
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
string(%d) "No syntax errors detected in %s011.test.php
|
|
"
|
|
string(40) "Could not open input file: some.unknown
|
|
"
|
|
string(%d) "
|
|
Parse error: %s expecting %s{%s in %s on line %d
|
|
Errors parsing %s011.test.php
|
|
"
|
|
Done
|