From d7616a176afc641e9693266920cb11e84c352241 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 23 Jan 2024 06:38:08 +0800 Subject: [PATCH] [10.x] Test Improvements (#49785) extracted from #49764 Signed-off-by: Mior Muhammad Zaki Co-authored-by: kylekatarnls --- .../Console/Scheduling/SubMinuteSchedulingTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php b/tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php index bc7b98d5b1b4..05f220576f79 100644 --- a/tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php +++ b/tests/Integration/Console/Scheduling/SubMinuteSchedulingTest.php @@ -101,7 +101,7 @@ public function test_sub_minute_scheduling_can_be_interrupted() Sleep::whenFakingSleep(function ($duration) use ($startedAt) { Carbon::setTestNow(now()->add($duration)); - if (now()->diffInSeconds($startedAt) >= 30) { + if ($startedAt->diffInSeconds() >= 30) { $this->artisan('schedule:interrupt') ->expectsOutputToContain('Broadcasting schedule interrupt signal.'); } @@ -130,11 +130,11 @@ public function test_sub_minute_events_stop_for_the_rest_of_the_minute_once_main Sleep::whenFakingSleep(function ($duration) use ($startedAt) { Carbon::setTestNow(now()->add($duration)); - if (now()->diffInSeconds($startedAt) >= 30 && ! $this->app->isDownForMaintenance()) { + if ($startedAt->diffInSeconds() >= 30 && ! $this->app->isDownForMaintenance()) { $this->artisan('down'); } - if (now()->diffInSeconds($startedAt) >= 40 && $this->app->isDownForMaintenance()) { + if ($startedAt->diffInSeconds() >= 40 && $this->app->isDownForMaintenance()) { $this->artisan('up'); } });