Add cascade delete on AuthLog table

This commit is contained in:
Bubka
2024-04-25 13:21:24 +02:00
parent 4987e060c4
commit 99bf9d7d80
2 changed files with 14 additions and 0 deletions

View File

@ -2,6 +2,7 @@
namespace Tests\Feature\Models;
use App\Models\AuthLog;
use App\Models\Group;
use App\Models\TwoFAccount;
use App\Models\User;
@ -113,6 +114,7 @@ class UserModelTest extends FeatureTestCase
{
$user = User::factory()->create();
TwoFAccount::factory()->for($user)->create();
AuthLog::factory()->for($user, 'authenticatable')->create();
Group::factory()->for($user)->create();
DB::table('webauthn_credentials')->insert([
@ -154,6 +156,9 @@ class UserModelTest extends FeatureTestCase
$this->assertDatabaseMissing(config('auth.passwords.users.table'), [
'email' => $user->email,
]);
$this->assertDatabaseMissing('auth_logs', [
'authenticatable_id' => $user->id,
]);
}
/**