As the topic title says, how can we run tests that already exists in basic and advanced templates ? I am especially interested in how to run tests in advanced template, since that template is very fragmented; frontend, backend, common… How to run all these tests ? In Laravel after you install codeception using composer, you would just run
vendor/bin/codecept run
Or if you have codeception globaly installed
codecept run
from the root of your application. That does not work with yii2, and I red that testing works out of box with yii2. Also, where do we specify testing configuration ? Like testing database ? In Laravel, you would have testing configuration files, and Laravel would use them automaticaly when you run tests. How to set up and use testing configuration in yii2 ? In advanced application you can set up development or production environments, I do not know what to do to set up testing one… And to be honest I do not understand how dev. and prod. environments work in yii2, I just see that some config files exists in like 5 different places, and do not know which ones to use. Any help please ? Thanks
Ok, here is the thing. First you need codeception installed globally. Next you will have to install additional packages using composer, like Specify and Verify. Next you will have to rebuild codecept using
codecept build
command. After that you need to install 3 databases that advanced yii2 app is using for testing. Readme file will tell you that you have to migrate databases in every test suite of your application, but that does not work. You can try to migrate standart yii database migration inside test databases, I have done that. But next problem comes that acceptance test will fail with message “I am on page “/advanced/frontend/web/index-test.php?r=site%2Fsignup””. And I don’t know what to do with this. Now I am just wandering, howcome using codeception to test baceme so complicated in yii . I give up, this is just a mess.