問題描述
如何安裝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
我該如何解決這個錯誤?
How can I fix this error?
推薦答案
舊答案 (2014):據(jù)說從 2014 年 12 月起,phpunit 將無法通過 PEAR 使用.
所以使用 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:它應該作為本地(對于您的項目)開發(fā)包安裝:
Update 2019: it should be installed as a local (for your project) development package:
composer require --dev phpunit/phpunit ^8
2020 年更新:它應該作為本地(對于您的項目)開發(fā)包安裝:作曲家需要 --dev phpunit/phpunit ^9.3
Update 2020: it should be installed as a local (for your project) development package: composer require --dev phpunit/phpunit ^9.3
這篇關于在 windows 上安裝 phpunit的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!