Friday, January 7, 2022

[FIXED] Laravel : phpunit cannot open file ExampleTest.php

Issue

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.


Solution

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

Example:

phpunit tests/ExampleTest.php


Answered By - Leonardo Emanuel Alifraco

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.