Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Recommend to load fixtures in `function _before()` and set `cleanup: false`?

Aperta
#35 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
documentation

Direzione di ricerca

Inizia leggendo la documentazione del modulo Doctrine all’indirizzo https://codeception.com/docs/modules/Doctrine e gli esempi dell’issue che usano cleanup, _before(), runShellCommand() e doctrine:fixtures:load. Riproduci il comportamento per verificare se le transazioni di cleanup nascondono le modifiche dei test ai comandi esterni, quindi determina se la documentazione dovrebbe raccomandare cleanup: false e il caricamento delle fixture prima di ogni test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I'm observing that with cleanup: true, running external commands with $I->runShellCommand('php bin/console ...'); isn't working. I'm guessing this is due to the transaction, which prevents external processes to "see" the database contents created/modified by the test. Can you confirm this?

If so, I would suggest to change the recommendation at https://codeception.com/docs/modules/Doctrine to cleanup: false, and show people how to load their fixtures in function _before():

$I->runShellCommand('php bin/console doctrine:fixtures:load --no-interaction --env=test');

IMO the currently recommended way to cleanup after each test doesn't work out, since for some tests it's necessary to disable the transaction (see above) - which ultimately leads to a mess.
So I'm figuring the best approach would be to just reload the fixtures before each test.

What do you think? How do you handle that?

Lingua principale
PHP
Stelle
4
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Codeception/module-doctrine

Tutte le issue di Codeception/module-doctrine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.