HomeContact
Computerz
Install phpunit on windows
René Dohmen
February 23, 2015
1 min

You can use composer to install phpunit, for example, inside a Symfony2 project; but it’s better to install it as a separate binary as it allows you to run unit test on all php scripts and it integrates better in phpStorm.

Create folder to hold php bins

I used an Applications folder in my windows home; but you can also user C:bin or something like that. Add the folder to your Path: e.g. add “;C:bin” to your PATH environment variable. In the Advanced System Properties, Environment variables:

2015-02-23 13_35_17-ProgramManager
2015-02-23 13_35_17-ProgramManager

2015-02-2313_36_31-ProgramManager
2015-02-2313_36_31-ProgramManager

Download the .phar file

Download https://phar.phpunit.de/phpunit.phar and save the file as C:binphpunit.phar

Create a .bat wrapper

Open a command line (e.g., press Windows+R » type cmd » ENTER)

Verify that it worked by openening a new command line: type “phpunit” and press enter. It should show the phpunit options.


Related Posts

Deploy FastAPI on Amazon Serverless
May 15, 2021
5 min
© 2021, All Rights Reserved.
Powered by formatics

Quick Links

Advertise with usAbout UsContact Us

Social Media