zoukankan      html  css  js  c++  java
  • CI集成phpunit Error: No code coverage driver is available 的解决

    CI集成phpunit时,运行报No code coverage driver is available的错误,如下图:

     

    yanglingdeMacBook-Pro:tests yangling$ phpunit
    PHPUnit 6.1.3 by Sebastian Bergmann and contributors.
     
    Error:         No code coverage driver is available
     
    ....                                                                4 / 4 (100%)
     
    Time: 220 ms, Memory: 10.00MB
    

      请检查是否正确安装xdebug

    yanglingdeMacBook-Pro:tests yangling$ php -i | grep xdebug
    

      如果你像上图一样提示,恭喜,你肯定没有出现以上错误。

      如果查找不到xdebug,可以使用brew进行安装xdebug,安装和你的php版本一致的xdebug

    brew search xdebug
    brew install homebrew/php/php70-xdebug
    ##宝宝的是php7.0.8
    

      CLi:

    yanglingdeMacBook-Pro:tests yangling$ php -i | grep xdebug
    xdebug
    xdebug support => enabled
    xdebug.auto_trace => Off => Off
    xdebug.cli_color => 0 => 0
    xdebug.collect_assignments => Off => Off
    xdebug.collect_includes => On => On
    xdebug.collect_params => 0 => 0
    xdebug.collect_return => Off => Off
    

      

    再运行phpunit

    	
    	PHPUnit 6.1.3 by Sebastian Bergmann and contributors.
    	
    	....                                                                4 / 4 (100%)
    	
    	Time: 577 ms, Memory: 14.00MB
    	
    	OK (4 tests, 4 assertions)
    	
    	Generating code coverage report in Clover XML format ... done
    	
    	Generating code coverage report in HTML format ... done
    

      好啦,成功啦!fighting

  • 相关阅读:
    http经典解析
    js实现canvas保存图片为png格式并下载到本地
    你所不知的 CSS ::before 和 ::after 伪元素用法
    js自动下载
    CSS 实现隐藏滚动条同时又可以滚动
    checkbox与文字对齐
    利用html2canvas截图,得到base64上传ajax
    bootstrap-datepicker简单使用
    移动端禁止滚动
    h5移动网页唤起App
  • 原文地址:https://www.cnblogs.com/linglingyang/p/6860185.html
Copyright © 2011-2022 走看看