5

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?

Community
  • 1
  • 1
Tarun
  • 3,456
  • 10
  • 48
  • 82
  • So you just want to get a general feeling of how much of the code base your tests are hitting? (As usually code coverage is not used when integration / frontend testing)? – edorian Dec 05 '11 at 09:13
  • Yes you are right. We want to write selenium tests for those part of application which are not covered already. – Tarun Dec 05 '11 at 09:34

1 Answers1

7

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.

symcbean
  • 47,736
  • 6
  • 59
  • 94