Hello Yii community!
I’ve been scratching an itch with a little extension I wrote and would like to release it more publicly but want to be sure to provide proper tests before doing so. This has brought up two questions for me:
-
What’s the proper protocol for packaging and running tests with extensions? I’ve not seen too much writing on the subject and really would like to package my tests with the release. I realize I could include a tests/ folder and just expect users to copy it over but is there a better way?
-
When a test involves interacting with a datafile (eg, opening, closing, writing), is there a best practice for dealing with the file? Should I package a sample file and copy / write / destroy? Should I attempt to file_put_contents on the fly? Is there a preferred location for temporary test data files to live?
Thank you so much for your help. Looking forward to giving back a bit.