PHP: install and enable xdebug for code coverage reports

Merged username-removed-1153258 requested to merge timacdonald/gitlab-ci-yml:xdebug-laravel into master

The script already has PHPUnit setup to produce code coverage reports, but Xdebug is not installed during the process, thus code coverage reports are not actually generated.

I am new to the pipelines and these scripts - and also to Xdebug, so someone with more experience may be able to correct me, however I wrestled with this for a day and finally got the code coverage working by installing Xdebug via Pecl and then enabling it with docker-php-ext-enable xdebug.

Without doing this, running the tests would just issue the below issue. It does not cause the job to fail.


Xdebug installation docs:

I've been using this and it has been working a treat.

Edited by username-removed-1153258