在Windows上安装phpunit [英] Install phpunit on windows
本文介绍了在Windows上安装phpunit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何安装phpunit?
How to install phpunit?
我阅读了文档 https://github.com/sebastianbergmann/phpunit ,但出现错误:
I read documentation https://github.com/sebastianbergmann/phpunit, but have an error:
>pear upgrade PEAR
Nothing to upgrade
>pear config-set auto_discover 1
config-set succeeded
>pear install pear.phpunit.de/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed
如何解决此错误?
推荐答案
旧答案(2014年):
据说自2014年12月起将无法通过PEAR使用phpunit.
因此,使用 composer :
Old answer (2014):
It's said that phpunit will not be available via PEAR since December 2014.
So it's easy to install it using composer:
composer global require "phpunit/phpunit=4.1.*"
更新2019 :它应作为本地(针对您的项目)开发包安装:
Update 2019: it should be installed as a local (for your project) development package:
composer require --dev phpunit/phpunit ^8
这篇关于在Windows上安装phpunit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文