Skip to content
Advertisement

Laravel : phpunit cannot open file ExampleTest.php

Hi i am quit new in Laravel PHPUnit, getting the following error :

Laravel : phpunit cannot open file ExampleTest.php

I don’t have idea why i am getting this error. I installed PHPUnit globally and when i run “phpunit” in terminal it runs fine. But I want to run it on specific file like :

phpunit ExampleTest

Thanks In Advance.

Advertisement

Answer

Make sure you are on the project root and referencing the file inside the tests folder.

Example:

phpunit tests/ExampleTest.php
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement