YiiBoilerplate icon indicating copy to clipboard operation
YiiBoilerplate copied to clipboard

mass Unit Test?

Open infoitservit opened this issue 10 years ago • 1 comments

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?

infoitservit avatar Jan 30 '15 17:01 infoitservit

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

hijarian avatar Feb 16 '15 09:02 hijarian