hasMiddleware(CheckBadIps::class))->toBeTrue(); }); it('does not register the middleware twice when the app also adds it', function () { app(Kernel::class)->pushMiddleware(CheckBadIps::class); $count = collect(app(Kernel::class)->getGlobalMiddleware()) ->filter(fn ($middleware) => $middleware === CheckBadIps::class) ->count(); expect($count)->toBe(1); }); it('schedules a daily prune', function () { $event = collect(app(Schedule::class)->events()) ->first(fn ($event) => str_contains($event->command ?? '', 'bad-ip-blocker:prune')); expect($event)->not->toBeNull() ->and($event->expression)->toBe('0 0 * * *'); });