diff options
author | Xinchen Hui <laruence@php.net> | 2013-03-28 13:45:42 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-03-28 13:45:42 +0800 |
commit | 467cd6a60f2909c14e5273e3fd4a98953779a5b8 (patch) | |
tree | ee9df9ef8ef2accc0e5f962d8bf670a213a0bb23 /sapi/cli | |
parent | 1182a3356c6c1989a686aab5258e1d47c56b2955 (diff) | |
download | php-git-467cd6a60f2909c14e5273e3fd4a98953779a5b8.tar.gz |
Add test for #64529
Diffstat (limited to 'sapi/cli')
-rw-r--r-- | sapi/cli/tests/bug64529.phpt | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sapi/cli/tests/bug64529.phpt b/sapi/cli/tests/bug64529.phpt new file mode 100644 index 0000000000..0c2d0e1c8b --- /dev/null +++ b/sapi/cli/tests/bug64529.phpt @@ -0,0 +1,62 @@ +--TEST-- +Bug #64529 (Ran out of opcode space) +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test"); +if (!trim(`which expect`)) die "skip no expect installed"; +?> +--FILE-- +<?php +$expect_executable = trim(`which expect`); +$php_executable = getenv('TEST_PHP_EXECUTABLE'); +$script = __DIR__ . "/expect.sh"; + +if (extension_loaded("readline")) { + $expect_script = <<<SCRIPT + +set php_executable [lindex \$argv 0] + +spawn \$php_executable -n -a + +expect "php >" + +send "echo 'hello world';\n" +send "\04" + +expect eof + +exit + +SCRIPT; + +} else { + $expect_script = <<<SCRIPT + +set php_executable [lindex \$argv 0] + +spawn \$php_executable -n -a + +expect "Interactive mode enabled" + +send "<?php echo 'hello world';\n" +send "\04" + +expect eof + +exit + +SCRIPT; +} + +file_put_contents($script, $expect_script); + +system($expect_executable . " " . $script . " " . $php_executable); + +@unlink($script); +?> +--EXPECTF-- +spawn %sphp -n -a +Interactive %s + +%secho 'hello world'; +hello worl%s |