mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-03 16:24:55 +00:00
🔥 **Cleanup:** Removed BookCase and OrangePill models, factories, migrations, and related references. Added tests for new service and meetup creation flows. Updated PHPUnit settings and browser-specific configurations.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Models\LoginKey;
|
||||
use App\Models\User;
|
||||
|
||||
it('deletes login keys older than 1 day and keeps recent ones', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$old = LoginKey::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'created_at' => now()->subDays(2),
|
||||
'updated_at' => now()->subDays(2),
|
||||
]);
|
||||
$recent = LoginKey::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'created_at' => now()->subHours(2),
|
||||
'updated_at' => now()->subHours(2),
|
||||
]);
|
||||
|
||||
$this->artisan('loginkeys:cleanup')->assertExitCode(0);
|
||||
|
||||
expect(LoginKey::query()->find($old->id))->toBeNull();
|
||||
expect(LoginKey::query()->find($recent->id))->not->toBeNull();
|
||||
});
|
||||
|
||||
it('runs cleanly when no login keys exist', function () {
|
||||
$this->artisan('loginkeys:cleanup')->assertExitCode(0);
|
||||
});
|
||||
Reference in New Issue
Block a user