Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top