简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM