Skip to content

Support sapi/cli/tests/017.phpt on Windows, too #9474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions sapi/cli/tests/017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ include "skipif.inc";
if (readline_info('done') !== NULL) {
die ("skip need readline support using libedit");
}
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
die('skip not for Windows');
}
?>
--FILE--
<?php
$php = getenv('TEST_PHP_EXECUTABLE');
$ini = getenv('TEST_PHP_EXTRA_ARGS');
$descriptorspec = [['pipe', 'r'], STDOUT, STDERR];

$codes = array();

Expand Down Expand Up @@ -55,8 +54,10 @@ EOT;

foreach ($codes as $key => $code) {
echo "\n--------------\nSnippet no. $key:\n--------------\n";
$code = escapeshellarg($code);
echo `echo $code | "$php" -a`, "\n";
$proc = proc_open("$php $ini -a", $descriptorspec, $pipes);
fwrite($pipes[0], $code);
fclose($pipes[0]);
proc_close($proc);
}

echo "\nDone\n";
Expand All @@ -69,7 +70,6 @@ Interactive shell

Hello world


--------------
Snippet no. 2:
--------------
Expand All @@ -79,7 +79,6 @@ multine
single
quote


--------------
Snippet no. 3:
--------------
Expand All @@ -90,15 +89,13 @@ comes
the
doc


--------------
Snippet no. 4:
--------------
Interactive shell

Done


--------------
Snippet no. 5:
--------------
Expand All @@ -107,5 +104,4 @@ Interactive shell

Parse error: Unmatched ')' in php shell code on line 1


Done