Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions example/05-process-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
fwrite(STDOUT, "[$name] $output");
}
if(strlen($error) > 0) {
fwrite(STDOUT, "[$name ERROR] $error");
fwrite(STDOUT, "[$name *] $error");
}
}

Expand All @@ -43,4 +43,4 @@

echo "Program quit. Exit codes:" . PHP_EOL;
echo "numbers.php exited with code " . $procNum->close() . PHP_EOL;
echo "letters.php exited with code " . $procLet->close() . PHP_EOL;
echo "letters.php exited with code " . $procLet->close() . PHP_EOL;
2 changes: 1 addition & 1 deletion src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function read(int $pipe = Process::PIPE_OUT):string {

foreach($outLines as $line) {
if($pipe === Process::PIPE_ERROR) {
$output .= "[$name ERROR] $line";
$output .= "[$name *] $line";
}
else {
$output .= "[$name] $line";
Expand Down
8 changes: 4 additions & 4 deletions test/phpunit/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public function testRead() {
);

self::assertStringContainsString(
"[test2 ERROR] Here is an error from proc2",
"[test2 *] Here is an error from proc2",
$error
);
self::assertStringContainsString(
"[test1 ERROR] Here is an error from proc1",
"[test1 *] Here is an error from proc1",
$error
);
}
Expand Down Expand Up @@ -126,11 +126,11 @@ public function testReadError() {

$error = $sut->readError();
self::assertStringContainsString(
"[test2 ERROR] Here is an error from proc2",
"[test2 *] Here is an error from proc2",
$error
);
self::assertStringContainsString(
"[test1 ERROR] Here is an error from proc1",
"[test1 *] Here is an error from proc1",
$error
);
}
Expand Down