YiiBoilerplate
YiiBoilerplate copied to clipboard
mass Unit Test?
How could I execute one time unit test for different test classes (with their own test methods) without incur in the error for which i can't create more than one Yii Application?
Proper answer: you do not create a Yii Application
object in the unit tests, as they will become integrated tests in such a case (unless, of course, you are testing this specific object itself without its environment).
Answer to exactly your own problem: PHPUnit has a special feature of bootstrap file:
./bin/phpunit --bootstrap=./tests/bootstrap.php tests/units
The above incantation will execute the ./tests/bootstrap.php
before running all PHPUnit test classes from tests/units
subdirectory. See in documentation, as usual: https://phpunit.de/manual/current/en/textui.html