$PHP = '\\' === \DIRECTORY_SEPARATOR ? '"!PHP!"' : '"$PHP"';
$successOutputPhp = <<<EOT
RUN php -r
$PHP
OUT 42
RES Command ran successfully
EOT;
$errorMessage = 'An error occurred';
$args =
new Process(['php', '-r', 'echo 42;'
]);
$args =
$args->
getCommandLine();
$successOutputProcessDebug =
str_replace("'php' '-r' 'echo 42;'",
$args,
$successOutputProcessDebug);
return [ ['', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null
],
[$successOutputVerbose, 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERY_VERBOSE, null
],
[$successOutputDebug, 'php -r "echo 42;"', StreamOutput::VERBOSITY_DEBUG, null
],
[$successOutputDebugWithTags, 'php -r "echo \'<info>42</info>\';"', StreamOutput::VERBOSITY_DEBUG, null
],
['', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null
],
[$syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null
],
[$syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null
],
[$errorMessage.\PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE,
$errorMessage],
[