使用 Composer 安装 PHPUNIT
我在Symfony 2上有项目,我想在Windows 7上使用PHPUNIT。
On githut phpunit is:
Composer
Simply add a dependency on phpunit/phpunit to your project's composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a development-time dependency on PHPUnit 3.7:
{
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
For a system-wide installation via Composer, you can run:
composer global require 'phpunit/phpunit=3.7.*'
Make sure you have ~/.composer/vendor/bin/ in your path.
首先,我使用系统范围的安装,但我不知道何时安装。接下来,我添加到我的 composer.json require-dev。这在C:/wamp/www/myproject/vendor/symfony中安装了phpunit。接下来我尝试命令:
composer install --dev
我不能使用phpunit。在cmd.exe我输入“phpunit”,我有错误:
'phpunit' is not recognized as an internal or external command operable program or batch file
我如何使用 phpunit?我有Windows 7,Wamp服务器和php 5.4.12。