Support the ongoing development of Laravel.io →
Installation Configuration Testing
Last updated 1 year ago.
0

try

./vendor/bin/phpunit 

from the project root

You can also alias phpunit

alias phpunit="/{pathtoproject}/vendor/bin/phpunit"
Last updated 1 year ago.
0

If you are a windows user then you should try executing command from your laravel project root directory as below,

laravel-project>vendor\bin\phpunit

Also, check in your bin directory that, phpunit.bat file is exist or not as i think in latest version it is not available so you need to import the dependencies for that.

Last updated 1 year ago.
0

i'm mac user. But i found where is my problem. i'm a beginner in testing, and i was thinking that phpunit was include in laravel, i didn't know i had to install it.

Thank you

Last updated 1 year ago.
0

The documentation is a bit misleading, assuming that you already have phpunit installed.

Last updated 1 year ago.
0

I ran into this today. I don't know what changed, I was able to run phpunit from my project root just a couple days ago and now suddenly I'm getting "phpunit: command not found"

With the friendly help from IRC, the solution for me was:

composer global require phpunit/phpunit

And making sure that I had "export PATH=$PATH:~/.composer/vendor/bin" in my .bash_profile

0

just cd inside app folder for laravel and alias phpunit="vendor/bin/phpunit"

0

NMaaruf said:

just cd inside app folder for laravel and alias phpunit="vendor/bin/phpunit"

I've tried a lot of other people's solutions and it seems that yours was the only one to work, thank you very much :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jeremy379 jeremy379 Joined 29 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.