我正在使用 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依赖项。 这将phpunit安装在C:/wamp/www/myproject/vendor/symfony目录下。接下来我尝试了一些命令:
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。