Child Process
NativePHP is currently in alpha development
Let's get to beta!#Fake Child Processes
#Example test case
Copied!
1use Native\Laravel\Facades\ChildProcess; 2 3#[\PHPUnit\Framework\Attributes\Test] 4public function example(): void 5{ 6 ChildProcess::fake(); 7 8 $this->get('/whatever-action'); 9 10 ChildProcess::assertGet('background-worker');11 ChildProcess::assertMessage(fn (string $message, string|null $alias) => $message === '{"some-payload":"for-the-worker"}' && $alias === null);12}
#Available assertions
-
assertGet
-
assertStarted
-
assertPhp
-
assertArtisan
-
assertStop
-
assertRestart
-
assertMessage