Annotation of embedaddon/php/sapi/cli/tests/011.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: syntax check
! 3: --SKIPIF--
! 4: <?php include "skipif.inc"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $php = getenv('TEST_PHP_EXECUTABLE');
! 9:
! 10: $filename = dirname(__FILE__)."/011.test.php";
! 11:
! 12: $code = '
! 13: <?php
! 14:
! 15: $test = "var";
! 16:
! 17: class test {
! 18: private $var;
! 19: }
! 20:
! 21: echo test::$var;
! 22:
! 23: ?>
! 24: ';
! 25:
! 26: file_put_contents($filename, $code);
! 27:
! 28: var_dump(`"$php" -n -l $filename`);
! 29: var_dump(`"$php" -n -l some.unknown`);
! 30:
! 31: $code = '
! 32: <?php
! 33:
! 34: class test
! 35: private $var;
! 36: }
! 37:
! 38: ?>
! 39: ';
! 40:
! 41: file_put_contents($filename, $code);
! 42:
! 43: var_dump(`"$php" -n -l $filename`);
! 44:
! 45: @unlink($filename);
! 46:
! 47: echo "Done\n";
! 48: ?>
! 49: --EXPECTF--
! 50: string(%d) "No syntax errors detected in %s011.test.php
! 51: "
! 52: Could not open input file: some.unknown
! 53: NULL
! 54: string(%d) "
! 55: Parse error: %s expecting %s{%s in %s on line %d
! 56: Errors parsing %s011.test.php
! 57: "
! 58: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>