Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Test Improvements #49785

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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