create([ 'status' => 'published', 'is_active' => true, 'date' => now()->subDay(), ]); $this->artisan('guest:feedback-reminders', ['--hours' => 0]) ->assertExitCode(0); $this->assertDatabaseHas('guest_notifications', [ 'event_id' => $event->id, 'type' => 'feedback_request', ]); // Running again should not duplicate notifications $this->artisan('guest:feedback-reminders', ['--hours' => 0]) ->assertExitCode(0); $this->assertDatabaseCount('guest_notifications', 1); } }