Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Make optional the auto-erase of the records, added by `haveInDatabase()`

Abierto
#68 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
php
Área
database, testing

Línea de trabajo

Comienza localizando la implementación de haveInDatabase() y el manejo de la configuración de skip_cleanup_if_failed. Rastrea dónde se borran automáticamente los registros después de las pruebas y confirma después que la configuración booleana elegida puede desactivar ese comportamiento, preservando el valor predeterminado existente y el comportamiento de limpieza tras un fallo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

Currently, all records, added by haveInDatabase() method during test, are automatically removed after the end of the test.
Although this is a documented behaviour, for me it adds more confusion than profit.

In case when I need all the changes, made during test, to disappear after the test, I can't rely solely on this behaviour, because changes may be done not only by haveInDatabase(). So I still need to use other things for keeping tests isolated (wrapping tests in transactions, or to re-populate database from dump before each test, etc).

And in other case, when I do not need tests isolation, I am ok with the fact that each test changes something in database, so auto-erasing some records only adds confusion for me.

So, I'd like to be able to turn this behaviour off in my tests.

Currently we have a skip_cleanup_if_failed configuration parameter, but it does not give full control over the auto-erase, because allows to omit it only when tests fail (which should be the default behaviour, IMHO). Also, its name is confusing (see issue #67).

Proposed solution

Let's add another boolean configuration parameter, responsible for this auto-erase. For example, auto_erase, or cleanup (could be used after renaming current cleanup to repopulate - see issue #67)

Lenguaje dominante
PHP
Estrellas
23
Forks
31
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Codeception/module-db

Todos los issues de Codeception/module-db

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.