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