我在 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 要求开发。这在 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。