【发布时间】:2015-01-12 00:15:59
【问题描述】:
我已经用作曲家安装了 PHPUnit。我在 composer.json 中有以下行
"require-dev": {
"phpunit/phpunit": "~4.3"
},
当我运行我的测试用例时,我遇到了错误。我已经搜索过这个错误,但在网络上找不到可能的相关解决方案:
Vishal@VISHAL-PC c:\xampp\htdocs\V4\test\Core
phpunit ResponseTest
PHPUnit 4.3.5 by Sebastian Bergmann.
Fatal error: Class PHPUnit_Util_DeprecatedFeature_Logger contains 1 abstract met
hod and must therefore be declared abstract or implement the remaining methods (
PHPUnit_Framework_TestListener::addRiskyTest) in C:\xampp\php\pear\PHPUnit\Util\
DeprecatedFeature\Logger.php on line 201
我不知道这是从哪里来的。任何建议,链接或评论将不胜感激。
【问题讨论】:
-
确保这个文件 C:\xampp\php\pear\PHPUnit\Util\DeprecatedFeature\Logger.php 有一个抽象方法,如果有,请尝试更改为接近 4.3.5 的另一个版本。
-
感谢@Pradeep!似乎它在 Loger.php 中没有抽象方法并添加了一个。它现在正在工作。
标签: php unit-testing web phpunit composer-php