Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install pcov:

    Code Block
    pecl install pcov

    Note the generated path to pcov.so, e.g. /usr/local/lib/php/extensions/no-debug-non-zts-20230831/pcov.so.

  2. Update php.ini. Note here also that we update the memory_limit to 8G:

    Code Block
    languageini
    memory_limit=8G
    
    [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

The php.ini may be found here: /usr/local/etc/php/php.ini

  1. Generate the report:

    Code Block
    phpunit --coverage-html /var/www/html/coverage_report /path/to/plugin/to/test

Viewing the reportusing Totara docker developer environment

...