2014-11-14 128 views
2

我已經用作曲家安裝了PHPUnit。我在composer.json中有下面的行PHP單元測試錯誤 - PHPUnit_Util_DeprecatedFeature_Logger

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

當我運行我的測試用例時,我得到下面的錯誤。我搜索了這個錯誤,但在Web我無法找到可能的相關解決方案:

 [email protected] 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 

我不知道如果這是來自。任何建議,鏈接或評論將不勝感激的傢伙。

+1

確保該文件C:\ XAMPP \ PHP \梨\ PHPUnit的\的Util \ DeprecatedFeature \ Logger.php有一個抽象方法,如果是,嘗試換到更接近4.3.5的另一個版本。 – Pradeep 2014-11-14 17:25:45

+0

謝謝@Pradeep!看起來像它沒有在Loger.php中的抽象方法,並添加了一個。它正在工作。 – Vish021 2014-11-14 19:54:15

回答

1

PHPUnit_Util_DeprecatedFeature_Logger類在PHPUnit 4.2中被刪除。如果您的PHPUnit 4.3安裝嘗試使用該類,這意味着您的安裝會以某種方式搞亂。

1

您仍然繼續從之前安裝的位置運行您的phpunit。若要從作曲家運行以下allias添加到您的.bashrc文件

sudo nano ~/.bashrc 

alias phpunit="/{path_to_project}/vendor/bin/phpunit"