php-src/sapi/cli/tests/011.phpt

59 lines
762 B
Plaintext
Raw Normal View History

2006-11-24 13:32:07 +00:00
--TEST--
syntax check
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
2007-01-20 22:12:45 +00:00
$php = getenv('TEST_PHP_EXECUTABLE');
2006-11-24 13:32:07 +00:00
$filename = dirname(__FILE__)."/011.test.php";
$code = '
<?php
$test = "var";
class test {
private $var;
}
echo test::$var;
?>
';
file_put_contents($filename, $code);
2007-04-19 07:00:57 +00:00
var_dump(`"$php" -n -l $filename`);
var_dump(`"$php" -n -l some.unknown`);
2006-11-24 13:32:07 +00:00
$code = '
<?php
class test
private $var;
}
?>
';
file_put_contents($filename, $code);
2007-04-19 07:00:57 +00:00
var_dump(`"$php" -n -l $filename`);
2006-11-24 13:32:07 +00:00
@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) "
2006-12-19 13:11:30 +00:00
Parse error: %s expecting %s{%s in %s on line %d
2006-11-24 13:32:07 +00:00
Errors parsing %s011.test.php
"
Done