Child Process
Fake Child Processes#
Example test case#
Copied!
use Native\Desktop\Facades\ChildProcess; #[\PHPUnit\Framework\Attributes\Test]public function example(): void{ ChildProcess::fake(); $this->get('/whatever-action'); ChildProcess::assertGet('background-worker'); ChildProcess::assertMessage(fn (string $message, string|null $alias) => $message === '{"some-payload":"for-the-worker"}' && $alias === null);}
Available assertions#
assertGetassertStartedassertPhpassertArtisanassertNodeassertStopassertRestartassertMessage