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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With