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

  • 相关阅读:
    前缀和
    不用加减乘除做加法
    数组中重复的数字
    滑动窗口的最大值
    矩阵中的路径
    Redis 和 Memcached 的区别 Tair
    机器人的运动范围
    汉诺塔问题
    洗牌算法
    斐波那契查找算法(黄金分割查找算法)
  • 原文地址:https://www.cnblogs.com/linglingyang/p/6860185.html
Copyright © 2011-2022 走看看