Windows
Globally installing the PHAR involves the same procedure as manually installing Composer on Windows:
-
Create a directory for PHP binaries; e.g.,
C:in -
Append
;C:into yourPATHenvironment variable (related help) -
Download https://phar.phpunit.de/phpunit.phar and save the file as
C:inphpunit.phar -
Open a command line (e.g., press Windows+R » type
cmd» ENTER) -
Create a wrapping batch script (results in
C:inphpunit.cmd):C:Usersusername>cd C:inC:in>echo @php "%~dp0phpunit.phar" %* > phpunit.cmdC:in>exit -
Open a new command line and confirm that you can execute PHPUnit from any path:
C:Usersusername>phpunit --versionPHPUnit x.y.z by Sebastian Bergmann and contributors.