Testing kit: reject cached non-test database connections before refresh

Aperta
#754 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
laravel, php, postgresql
Ambito
database, testing

Direzione di ricerca

Start with the base test class Teme\Testing\TemeTestCase and see where it reaches Laravel's RefreshDatabase setup, then check how a cached configuration (bootstrap/cache/config.php) overrides the PHPUnit database settings. Add a regression test where the cached connection differs from the PostgreSQL test target. Done when that test stops before any refresh and the error names the effective and expected database and explains how to clear the config cache. The issue leaves open whether to reject the cache or verify the connection, so confirm the approach in the thread first.

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

Descrizione

area/themes type/bug when/soon

A theme test run inherited a Laravel configuration cache that pointed to the normal site database. Although PHPUnit specified the dedicated PostgreSQL test configuration, the values in the cached application configuration took precedence. Teme\Testing\TemeTestCase reached Laravel's RefreshDatabase setup and reset the local site's schema before a test assertion ran.

Expected: the kit rejects a cached configuration or verifies the effective database connection against the configured test target before invoking the database refresh. The error should name the effective database and expected test target and explain how to bypass the config cache for a test run. Add regression coverage for a cache whose database disagrees with PHPUnit.

For the theme verification, bypassing the config cache and explicitly using the dedicated PostgreSQL test database kept subsequent tests isolated.

Lingua principale
PHP
Stelle
1
Fork
1
Merge medio
1h 40m
PR unite (30g)
143

Preparare l'ambiente

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 temecms/teme

Tutte le issue di temecms/teme

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.