GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - iamsujun/php-code-coverage

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.env
.env
 
 
README.md
README.md
 
 
build.sh
build.sh
 
 
composer.json
composer.json
 
 
prepend.php
prepend.php
 
 

Repository files navigation

PHP代码覆盖率

对于PHP代码,基于php-code-coverage、phpcov生成代码覆盖率报告:

  • php-code-coverage用来生成php代码覆盖率报告
  • phpcov用来合并多请求覆盖率结果,生成报告结果

xdebug安装

pecl install xdebug

在php.ini配置文件中增加配置:

[XDebug]
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.remote_autostart=on

pacakge安装

composer install

prepend.php文件引入

在代码执行时,提前引入prepend.php文件;为降低对业务仓库的侵入,可在nginx里面配置,也可在PHP.ini里面配置。

nginx配置方法:

fastcgi_param PHP_VALUE "auto_prepend_file=/data/www/php-code-coverage/prepend.php";

php.ini配置方法:

auto_prepend_file=/data/www/php-code-coverage/prepend.php

覆盖率报告生成

测试用例执行后,运行bash build.sh生成覆盖率报告。


参考文章:

  • PHP代码覆盖率
  • TextUI frontend for php-code-coverage
  • Library that provides collection, processing, and rendering functionality for PHP code coverage information.

About

No description or website provided.

Topics

code-coveragephp

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.