php7 phpunit,php7 环境下安装 phpunit6

本文详细介绍了安装PHPUnit6.0的要求和步骤,包括PHP版本需求、默认启用的DOM和JSON扩展,以及必须的pcre、reflection、spl扩展。另外,提到了代码覆盖率分析需要Xdebug和tokenizer扩展,生成XML报告则需要xmlwriter扩展。提供了安装phpunit.phar文件的命令行步骤,并提示了验证安装版本的方法。
摘要由CSDN通过智能技术生成

最新的PHPUnit 6.0 需要php5.6以上的版本,PHPUnit 需要的DOM和JSON是默认启动的,一般不需要单独安装。

PHPUnit 还需要 :

pcre [http://php.net/manual/en/pcre.installation.php]、

reflection [http://php.net/manual/en/reflection.installation.php]、spl[http://php.net/manual/en/spl.installation.php] 扩展。这些标准扩展默认启用,并且除非修改 PHP 的构建系统和 C 源代码,否则无法禁用它们。

代码覆盖率分析报告功能需要 Xdebug [http://xdebug.org/] (2.2.1以上)与 tokenizer [http://php.net/manual/en/tokenizer.installation.php] 扩展。生成 XML 格式的报告需要有 xmlwriter[http://php.net/manual/en/xmlwriter.installation.php] 扩展。

下面是安装步骤:

$ wget https://phar.phpunit.de/phpunit.phar

$ chmod +x phpunit.phar

$ sudo mv phpunit.phar /usr/local/bin/phpunit

$ phpunit --version

参照来源:

github:https://github.com/sebastianbergmann/phpunit

phpunitbook:http://www.phpunit.cn/manual/current/zh_cn/phpunit-book.pdf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值