Skip to content

Commit

Permalink
[10.x] Test Improvements (#49785)
Browse files Browse the repository at this point in the history
extracted from #49764

Signed-off-by: Mior Muhammad Zaki <[email protected]>
Co-authored-by: kylekatarnls <[email protected]>
  • Loading branch information
crynobone and kylekatarnls authored Jan 22, 2024
1 parent 91bc0f6 commit d7616a1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down Expand Up @@ -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');
}
});
Expand Down

0 comments on commit d7616a1

Please sign in to comment.