Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mass Unit Test? #87

Open
infoitservit opened this issue Jan 30, 2015 · 1 comment
Open

mass Unit Test? #87

infoitservit opened this issue Jan 30, 2015 · 1 comment

Comments

@infoitservit
Copy link

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?

@hijarian
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants