withoutMiddleware([DecideWhatToDoWithUser::class, CheckForcePasswordReset::class]); Once::flush(); if (! InstanceSettings::find(0)) { $settings = new InstanceSettings; $settings->id = 0; $settings->saveQuietly(); } }); describe('logs:scheduled --date option', function () { test('rejects a malformed date and exits before touching the shell', function () { $this->artisan('logs:scheduled', ['--date' => '2025-01-01; touch /tmp/pwn']) ->expectsOutputToContain('Invalid date format') ->assertExitCode(ViewScheduledLogs::INVALID); expect(file_exists('/tmp/pwn'))->toBeFalse(); }); test('accepts a well-formed date', function () { $this->artisan('logs:scheduled', ['--date' => '2025-01-01']) ->assertExitCode(0); }); });