Skip to content

Commit

Permalink
Fix child test (should have never worked)
Browse files Browse the repository at this point in the history
But it did because the child process output was "childTjs=" but this is incorrect and cannot be unserialized.
  • Loading branch information
MarcHagen committed Aug 29, 2024
1 parent ac545b6 commit bc87ce6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/ChildRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public function it_can_run()
$autoloader = __DIR__.'/../vendor/autoload.php';

$serializedClosure = base64_encode(serialize(new SerializableClosure(function () {
echo 'child';
echo 'interfere with output';
return 'child';
})));

$process = new Process([
Expand All @@ -28,7 +29,10 @@ public function it_can_run()
$process->start();

$process->wait();
$output = unserialize(base64_decode($process->getOutput()));

$this->assertStringContainsString('child', $process->getOutput());
$this->assertIsArray($output);
$this->assertArrayHasKey('output', $output);
$this->assertStringContainsString('child', $output['output']);
}
}

0 comments on commit bc87ce6

Please sign in to comment.