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

About Nick

Melbourne based web developer that loves building front-end systems with anything from vanilla JS to React. Infosec student and active learner. Subscribe to the blog

www ·

4 thoughts on “Laravel 5 “No tests found in TestCase” error”

  1. katjam

    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.
    Cheers,
    Christian
    MD
    M: 0488 445 645

  3. KBalazs

    Thank you!

  4. carlos moraes

    Nicee. tks

Leave a Reply

Your email address will not be published.

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