insert([ 'id' => 1, 'firstname' => 'Inactive', 'lastname' => 'User', 'email' => 'inactive@example.com', 'status' => 'Inactive', 'created_at' => now()->subMinutes(30), ]); DB::table('parents')->insert([ 'id' => 1, 'secondparent_firstname' => 'Second', 'secondparent_lastname' => 'Parent', 'secondparent_gender' => 'Female', 'secondparent_email' => 'second@example.com', 'secondparent_phone' => '1234567890', 'firstparent_id' => 1, 'secondparent_id' => 2, 'semester' => 'Spring', 'school_year' => '2024-2025', ]); DB::table('user_roles')->insert([ 'user_id' => 1, 'role_id' => 1, ]); $service = new InactiveUserCleanupService(); $result = $service->cleanup(15); $this->assertSame(1, $result['deleted_users']); $this->assertDatabaseMissing('users', ['id' => 1]); $this->assertDatabaseMissing('parents', ['firstparent_id' => 1]); $this->assertDatabaseMissing('user_roles', ['user_id' => 1]); } }