PHP代码覆盖率和Selenium [英] PHP code coverage and Selenium

查看:99
本文介绍了PHP代码覆盖率和Selenium的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SO上遇到了这个话题,该话题讨论了PHP代码覆盖工具- PHP

我从没在PHP上工作过,一直在用Java针对用PHP编写的应用程序编写Selenium UI测试. 在我前面提到的线程中,我感到(可能是错误的)当那些用PHP Unit编写的单元测试并且想要找到单元测试覆盖应用程序的程度时,将使用那些PHP代码覆盖工具. >

我正在寻找一种解决方案,在其中执行我编写的Java测试的Selenium测试,PHP应用程序代码库中会有一些钩子,从而提供了有关已执行的应用程序代码库和未执行的应用程序代码库的某种报告.

有可能这样做吗?

解决方案

只需添加一个自动前置脚本,该脚本调用xdebug_start_code_coverage()并注册一个关闭函数,该函数记录xdebug_get_code_coverage()的输出

然后再分析您的数据.

I came across this thread on SO which talks about PHP code coverage tools - Code Coverage tools for PHP

I have never worked on PHP and have been writing Selenium UI tests using java against an application which has been written in PHP. While going through the thread I mentioned above I felt (I might be wrong) that those PHP code coverage tools are to be used when there are unit tests written in PHP Unit and one wants to find how well Unit tests cover the application.

I am looking for a solution where I execute my Selenium tests which are written and java and there would be some hook in PHP application code base which gives some sort of report about application code base which was executed and one which was not.

Is it possible to do this?

解决方案

Just add an auto-prepend script which calls xdebug_start_code_coverage() and registers a shutdown function which logs the output of xdebug_get_code_coverage()

Then analyse your data later.

这篇关于PHP代码覆盖率和Selenium的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆