In our project, we run PHPUnit tests that use Selenium and Curl to open pages on another development server. Server B has an Apache server serving the website. Server A starts the test task by synchronizing ( Rsync ) the project files to the development server B, therefore the project files are identical on both servers.
What are the options for remote collection of code coverage statistics in PHP?
We already use Xdebug to collect code coverage on unit tests that are run locally on server A (PHPunit directly uses project files and therefore start / stop collecting code coverage reports )
Update:
On server B, the website is displayed by a PHP instance running Apache. During lunch tests using Selenium / Curl, the PHP instance on server A uses the command line version. This instance cannot profile the PHP instance that Apache runs on server B.
When performing unit tests (without using another server and without using Selenium / Curl), we use the following command:
phpunit --coverage-html ./results/codecoverage/ ATestFile.php
This generates a code coverage report for the test in "ATestFile.php" using Xdebug in PHP Cli.
source share