888, 'nombre' => 'Club Borrable']); $jugador = Jugador::create([ 'id_jugador' => 'T-SD-1', 'documento' => '11111111', 'nombre' => 'Borra', 'apellido' => 'Mela', 'id_club_actual' => $club->id_club, 'id_club_origen' => $club->id_club, 'activo' => true ]); $evento = Evento::create([ 'id_evento' => 'UUID-SD-1', 'nombre_evento' => 'Evento Prueba SD', 'fecha_evento' => now()->format('Y-m-d'), 'hora_inicio' => '18:00', 'hora_fin' => '20:00' ]); // 2. Ejecutar borrado $club->delete(); $jugador->delete(); $evento->delete(); // 3. Verificar que siguen en la base de datos (físicamente) pero con deleted_at $this->assertSoftDeleted('clubes', ['id_club' => 888]); $this->assertSoftDeleted('jugadores', ['id_jugador' => 'T-SD-1']); $this->assertSoftDeleted('eventos', ['id_evento' => 'UUID-SD-1']); // 4. Verificar que no aparecen en consultas normales $this->assertNull(Club::find(888)); // 5. Verificar que aparecen si usamos withTrashed() $this->assertNotNull(Club::withTrashed()->find(888)); } }