0

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?

6
  • It doesn't hang on that does it? You can try running it with phpunit --debug to see if it picks up the test. Only other thing worth checking is that you've run composer update and the autoload files have been generated correctly. Commented Mar 23, 2014 at 22:03
  • If no tests were found it should also output "no tests ran". You should grep your code for die() or exit(), and check your PHP CLI log for out of memory errors. Commented Mar 24, 2014 at 7:38
  • Thanks. No it does not hang. I have not changed anything with composer. Is there any config needed? I will run update and debug later. There is no other test file but the example test file by laravel. Commented Mar 24, 2014 at 8:32
  • Is it necessary to use or config composer? I only installed phpunit and nothing more. Commented Mar 24, 2014 at 16:50
  • Running phpunit --debug gives Configuration read from /Applications/MAMP/htdocs/survey-backend/phpunit.xml Starting test 'ExampleTest::testBasicExample'.. But there is no result. Commented Mar 24, 2014 at 20:01

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.