1
0
mirror of https://github.com/danog/process.git synced 2024-11-30 04:39:04 +01:00

Produce failing test for ext-task

This commit is contained in:
Niklas Keller 2018-07-12 08:46:13 +02:00
parent 717dabc883
commit 991ee9079b

View File

@ -40,11 +40,11 @@ class ProcessTest extends TestCase
public function testExecuteResolvesToExitCode(): void
{
$process = new Process(\DIRECTORY_SEPARATOR === "\\" ? "cmd /c exit 42" : "exit 42");
$process = new Process(\DIRECTORY_SEPARATOR === "\\" ? "cmd /c exit 42" : "echo 'foo'; sleep 2; exit 42");
/** @noinspection PhpUnhandledExceptionInspection */
$process->start();
$process->getStdout()->read();
Task::async(function () use ($process) { $process->getStdout()->read(); });
$code = $process->join();
$this->assertSame(42, $code);