...
Only for Totara 12: Install pcov/clobber which adds pcov support to PHPUnit 7
Code Block composer require pcov/clobber vendor/bin/pcov clobber
Ensure PHP has enough memory in /usr/local/etc/php/php.ini. Give it heaps, as code coverage is memory intensive.
Code Block memory_limit=8G
Enable and configure the extension in the php.ini. The
path/to/pcov.so
will be the one you noted down from step 1.Code Block [pcov] extension="path/to/pcov.so" pcov.enabled=1 pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~' pcov.initial.memory=1073741824 pcov.initial.files=30000
Generate the code coverage report
...