Search code examples
phpunittestcase

Laravel 4 No tests found in TestCase


I'm having some problems with phpunit. When I execute a test, phpunit give me these warnings:

1) Warning No tests found in class "Illuminate\Foundation\Testing\TestCase".

2) Warning No tests found in class "TestCase".

But I'd like to ignore these files, so that phpunit won't try to run tests from them.

How to do that?


Solution

  • Hopefully by now you found the answer but if you haven't this might help:

    Hmm - make sure that the filenames and class names all match up. For example, no FooTest class with a filename of BarTest.php.

    Also, are you positive that you have a *Test.php file within the app/tests directory?

    [...]

    That was it, i.e. one of my tests had a typo in the filename-vs-classname. Odd that typo kicks a warning in the TestCase classes and instead of flagging the class that actually caused it.

    From: https://laracasts.com/forum/?p=83-warnings-for-testcase-illuminate-foundation-testing-testcase/0

    Basically, make sure your file names and class names match up. I was banging my head on this one too.