I am developing an Yii 2 public (MIT) extension to change some of the yii\web\View
behaviours (minify, combine and many other optimizations).
I can do it easily. But I really want to write as many tests (codeception) as possible for it. This is where I am very confused.
I already have some unit tests (for example: testing a specific minifing, or returning combined minified result). But I would like to test the entire result and the final integration between my extension and the Yii2 web application using it.
I just would like some guidelines for this process:
-
Should I have a real (complete) app inside my extension for testing purposes? If so, should it be 'installed' inside tests dir?
-
Would you use functional testing ? (I think so because the
View
will find files inAssetBundles
, combine and minify them, publish the result as a single file and replace the assets' urls by new url (i.e., the optimized asset url) inside the view; -
Could you provide some very basic examples/guidelines?
I just would like to highlight that I dont intend you do my testing job, I really want to learn how to do it. This is why I really would be very grateful for any tips.
Thank you so much.
Aucun commentaire:
Enregistrer un commentaire