[Feature] Per-unit and per-class fixture configuration - PR welcome?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia da src/Codeception/Module/Yii2.php e analizza loadFixtures(), quindi esamina gli esempi collegati e l’implementazione proposta. Conferma l’API desiderata dal progetto per gli attributi di classe e di test e la sua compatibilità con fixturesMethod; il lavoro è completato quando i valori predefiniti dei fixture, gli override e il comportamento di disabilitazione sono concordati e coperti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Note: I may not be aware of all configuration options or available functionality, so please let me know if I'm missing something.
AFIK, there is the option to configure fixtures in the test configuration, as well as in the configured fixturesMethod (_fixtures).
In our project, humhub/humhub, we use the fixturesMethod to adjust the configured fixtures from the configuration based on the test case's need. Mainly to speed up tests that do not require db data or just a subset of it.
In some situations, however, it seems to make sense to collect several tests in one case, but only some of them do actually need the fixtures, or some need a different set.
Now we had the idea to use attributes to allow that fixtures to be configured: see examples and current suggested implementation (open for improvement).
The question of this issue is if there is interest that we would incorporate this feature into this project here, potentially in the loadFixtures() method. The logic could be
- If the
fixturesMethodis implemented, just use its result - Otherwise, check for class and test attributes and use their result, if present
If the new functionality is encapsulated in a public method (e.g. getTestFixtures()) and we would pass the yii2 module instance as an argument to the fixturesMethod for easy access, the fixturesMethod could still use that configuration and customize as required. By this, there would be full backwards-compatibility while supporting fixture configuration without the need to implement the fixturesMethod.
The annotations generally allow the following:
- define a default set of fixtures
- use a configuration array to reduce or extend the default set
- on test level, the class level can be overridden, also falling back to the original configuration
- a special class
FixturesNonewould simply disable any fixtures for the current test.
Thank you for considering this. Any feedback welcome.
Please note, the current code in the aforementioned PR is not designed to meet this project's guidelines. Happy to adapt accordingly if you'd be interested in considering an implementation in your code base.
- Lingua principale
- PHP
- Stelle
- 19
- Fork
- 42
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Codeception/module-yii2
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Codeception/module-yii2#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Codeception/module-yii2#144 · 1 commento · 1 reazione ·
-
MongoDB supportAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Codeception/module-yii2#142 · 4 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
Codeception/module-yii2#141 · 1 commento ·
-
Unable to load yii\elasticsearch\ActiveRecord-based fixturesForse di nuovo libera @Mikk36 l’ha presa 379 giorni fa e non c’è nessuna pull request aperta. Aperta
Codeception/module-yii2#134 · 4 commenti · 1 assegnatario ·
Tutte le issue di Codeception/module-yii2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
codeigniter4/CodeIgniter4#10616 ·
I maintainer di solito rispondono entro 1 giorno
-
bug code quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SemanticMediaWiki/SemanticMediaWiki#7149 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
FriendsOfFlarum/upload#527 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
google/site-kit-wp#13825 ·
I maintainer di solito rispondono entro 3 giorni