I have windows 07 64-bit OS and I have downloaded the composer as well as I am running wampserver wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-x64.exe . I have tried to install PHPUnit using composer but couldn't. I found the installation steps on linux/ mac os but not in windows. Some site suggested to add a dependency on phpunit/phpunit to the php project's composer.json file. But how? I don't know. Please help me for the installation of PHPUnit using composer on wampserver(windows 07-64 bit OS) or any alternatives..
Asked
Active
Viewed 5,099 times
2 Answers
13
You do the exact same thing you would do on Linux or OSX.
As from the docs over at: http://www.phpunit.de/manual/current/en/installation.html#installation.composer
.
{
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
and run php composer.phar install --dev
.
For a system wide install you do:
{
"name": "phpunit",
"description": "PHPUnit",
"require": {
"phpunit/phpunit": "3.7.*"
},
"config": {
"bin-dir": "C:/my/dir"
}
}
and add the directory to your windows $PATH
.

edorian
- 38,542
- 15
- 125
- 143
1
In this case I would suggest to use Pear. Usually you don't install just couple of php classes but also you might need to configure Windows to make phpunit running as tool.

Zdenek Machek
- 1,758
- 1
- 20
- 30
-
1Installing PHPUnit through PEAR is no longer supported. [Check this](http://stackoverflow.com/questions/12655136/install-phpunit-on-windows). – The Alpha Jun 18 '16 at 11:06
-
What's the point of commenting something 4 years old? And yes composer is only way in these days. – Zdenek Machek Jun 18 '16 at 21:27
-
1For future visitors (newbess who may fall in trap) :-) – The Alpha Jun 18 '16 at 23:41