Php code coverage when making a request

I am working on a PHP migration project which is very complex and huge.

I want to know if there is any tool out there to help me see that a line of codes has been executed when one page is displayed in the browser. This will help me find the codes to use and test the business logic and port the required code.

Just like the code coverage report, help us unit test. Is there something available to know the code to execute when making a specific request.

+3


source to share


1 answer


If you enable the XDebug profiler, you can use it to get code coverage data and use it later to identify unused code. More information can be found here: http://xdebug.org/docs/code_coverage



If you need a more formatted format, you can use the PHP-Code-Coverage lib that PHPUnit uses to generate reports. You can find an example of how we do it here: https://github.com/sebastianbergmann/php-code-coverage

+2


source







All Articles