Shlomo
Shlomo

Reputation: 3990

Laravel phpunit does not run any test

I cannot get any test to run, there are also no errors.

I downloaded phpunit and moved it to /usr/local/bin.

I did not do any config change on my fresh laravel installation.

cd to my laravel root directory. phpunit --version gives PHPUnit 4.0.12

There is an laravel example test located at /Applications/MAMP/htdocs/survey-backend/app/tests/ExampleTest.php.

Now, running tests with: phpunit outputs only:

Configuration read from /Applications/MAMP/htdocs/survey-backend/phpunit.xml

Why is the test not being executed?

Upvotes: 0

Views: 3319

Answers (2)

Steve Woodson
Steve Woodson

Reputation: 326

Wanted to note that I also had this issue and it ended up being that I used private rather than protected when adding a tearDown() method to the TestCase class.

Upvotes: 0

Shlomo
Shlomo

Reputation: 3990

This failed all the time due to a fatal error because I included classes in the start.php that were available when using via /public but were missing when calling from phpunit. I have now added them to composer.json and everything is working.

Upvotes: 1

Related Questions