Yii And Production Tests


I’m using BDD (Behat) with Yii. In order to make tests on separte db i’am using index-test.php in test base url. (index-test.php bootsrtaps testing db etc…)

But it’s sad that you should delete index-test.php when in production…so what about running tests in production (after deploment)???

I could use somthing like post deploment script which would copy index-test.php for a moment, run all test and remove index-test.php…but maybe there are other ways to achive thsi goal ????


I usually use one more installation (in addition to local and production versions) – test (staging). It allows perform tests at production environment not actually updating production version yet.

you mean:

devel --> production ---- test (staging)


                   --- production (real)

I assume test staging is seperate instance of project but put on production server ???

Sorry, didn’t get your scheme. Yes, I mean one more application installation on production server - usually I use it for tests and to check changes with the client before moving them to production.

If you use VCS (I use this scheme with git), then it’s convenient to have two main branches. Dev branch is deployed to Staging, Master branch is deployed to Production, having all current changes in temporary branches that are merged to Dev branch first (a bit more sophisticated approach is described at http://nvie.com/posts/a-successful-git-branching-model/ ). This is especially convenient if you have auto-deploy configured.

thank’s for your advice

think i will choose having staging with production