From 4400962e6135ac2057943297362366f01a550660 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 31 May 2024 18:49:26 +0800 Subject: [PATCH] Fixes tests when using Process 7.1 (#1456) Signed-off-by: Mior Muhammad Zaki --- tests/Feature/WorkerProcessTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Feature/WorkerProcessTest.php b/tests/Feature/WorkerProcessTest.php index e9f752a4..692dbad2 100644 --- a/tests/Feature/WorkerProcessTest.php +++ b/tests/Feature/WorkerProcessTest.php @@ -10,13 +10,14 @@ use Laravel\Horizon\WorkerProcess; use Symfony\Component\Process\Process; +use function Orchestra\Testbench\package_path; + class WorkerProcessTest extends IntegrationTest { public function test_worker_process_fires_event_if_stopped_process_cant_be_restarted() { Event::fake(); - - $process = new Process(['exit', 1]); + $process = Process::fromShellCommandline('exit 1', package_path()); $workerProcess = new WorkerProcess($process); $workerProcess->start(function () { }); @@ -31,7 +32,7 @@ public function test_process_is_not_restarted_during_cooldown_period() { Event::fake(); - $process = new Process(['exit', 1]); + $process = Process::fromShellCommandline('exit 1', package_path()); $workerProcess = new WorkerProcess($process); $workerProcess->start(function () { }); @@ -47,7 +48,7 @@ public function test_process_is_restarted_after_cooldown_period() { Event::fake(); - $process = new Process(['exit', 1]); + $process = Process::fromShellCommandline('exit 1', package_path()); $workerProcess = new WorkerProcess($process); $workerProcess->start(function () { });