Annotation of embedaddon/php/sapi/cli/tests/021.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: CLI shell shebang
! 3: --SKIPIF--
! 4: <?php
! 5: include 'skipif.inc';
! 6: if (substr(PHP_OS, 0, 3) == 'WIN') {
! 7: die ("skip not for Windows");
! 8: }
! 9:
! 10: if (strlen("#!".getenv('TEST_PHP_EXECUTABLE')) > 127) {
! 11: die ("skip shebang is too long, see http://www.in-ulm.de/~mascheck/various/shebang/#results");
! 12: }
! 13: ?>
! 14: --FILE--
! 15: <?php
! 16:
! 17: $php = getenv('TEST_PHP_EXECUTABLE');
! 18:
! 19: $filename = __DIR__.'/021.tmp.php';
! 20:
! 21: $script = "#!$php -n\n".
! 22: "ola\n".
! 23: "<?php echo 1+1,'\n';\n".
! 24: "?>\n".
! 25: "adeus\n";
! 26:
! 27: file_put_contents($filename, $script);
! 28: chmod($filename, 0777);
! 29:
! 30: echo `$filename`;
! 31:
! 32: echo "\nDone\n";
! 33: ?>
! 34: --CLEAN--
! 35: <?php
! 36: unlink(__DIR__.'/021.tmp.php');
! 37: ?>
! 38: --EXPECTF--
! 39: ola
! 40: 2
! 41: adeus
! 42:
! 43: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>