Versions Compared

Key

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

...

  1. Only for Totara 12: Install pcov/clobber which adds pcov support to PHPUnit 7

    Code Block
    composer require pcov/clobber
    vendor/bin/pcov clobber
  2. 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
  3. 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
  4. Generate the code coverage report

...