Adnan Haque
Adnan Haque

Reputation: 184

Laravel phpunit skipping custom test files

I have created a laravel test file using the command

php artisan make:test EventUserRelations

When I run phpunit, it is as if the file does not even exist. I tried to fail the test just to make sure it is being tested. Here is the code in the file:

class EventUserRelations extends TestCase
{
    public function testExample()
    {
        $this->fail();
    }
}

And here is the result.

phpunit --debug

PHPUnit 5.4.6 by Sebastian Bergmann and contributors.


Starting test 'ExampleTest::testBasicExample'.
.                                                                   1 / 1 (100%)

Time: 119 ms, Memory: 20.75MB

Upvotes: 2

Views: 285

Answers (1)

wwwroth
wwwroth

Reputation: 434

In Laravel test files need to end with ..test.php. So change EventUserRelations.php to EventUserRelationsTest.php and it should work.

Upvotes: 1

Related Questions