views:

415

answers:

1

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?

+2  A: 

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

Yada
straight to the point...an alternative way would be: right click My Computer, click on Properties, click on Advanced, click Environment Variables, modify the Path env. variable and add the directory (in my case C:\xampp\php ...thanks a lot!
Ygam