Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run phpunit command in Windows command line no matter what directory I am in?

all examples of phpunit I saw run the simple command line tool:

phpunit TestClass

but when I try the same on a directory other than the xampp php dir, I end up getting an "unknown command..."

Is there a way to execute the phpunit command from any directory in the Windows command line?

like image 247
yretuta Avatar asked Feb 02 '10 06:02

yretuta


1 Answers

Add the phpunit to your System PATH

Setting Path on Windows Start -> Control Panel -> System -> Advanced Click on Environment Variables, under System Variables, find PATH, and click on it. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value. Close the window. Reopen Command prompt window, and run phpunit TestClass

like image 72
Yada Avatar answered Nov 09 '22 18:11

Yada