Laravel 5 “No tests found in TestCase” error

If you’re running the default Laravel 5 tests with PHPUnit you might come across the above error. This is because there are no functions with “test” prepended to the start of them. In your TestCase.php file you shouldn’t really have any of that because it is setting up your application for testing.

To remove this test failure add “abstract” to the start of your class declaration for TestCase.php so the new line looks like:

abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
  1. This happened to me too, but only because my test file name didn’t match the class name in that file. By default, I think Laravel will not try to look for tests in TestCase.

  2. Hi Nick,
    I touched base with you 12 months ago about my project that was needing a Laravel Dev. Since I went forward and we are now live with 15,000 users and paying national clients.
    Are you available at the moment for any Laravel freelance work? We are looking to add a experience Laravel dev to our team of 8.
    M: 0488 445 645

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like