PHP 单元测试错误 - PHPUnit_Util_DeprecatedFeature_Logger


PHP Unit test Error - PHPUnit_Util_DeprecatedFeature_Logger

我已经在作曲家身上安装了PHPUnit。我在作曲家.json 中有以下行

  "require-dev": {
    "phpunit/phpunit": "~4.3"
},  

当我运行测试用例时,出现以下错误。我已经搜索了此错误,但我在 web 中找不到可能的相关解决方案:

        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

我不知道这是从哪里来的。任何建议,链接或评论将不胜感激。

PHPUnit_Util_DeprecatedFeature_Logger类在 PHPUnit 4.2 中被删除。如果你的PHPUnit 4.3安装尝试使用该类,这意味着你的安装以某种方式搞砸了。

您仍然可以继续从以前安装的位置运行 phpunit。要从作曲家运行它,请将以下 allias 添加到您的 .bashrc 文件中

sudo nano ~/.bashrc
alias phpunit="/{path_to_project}/vendor/bin/phpunit"