Versions Compared

Key

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

...

Add the following whitelist configuration to your phpunit.xml file directly after the closing </php> tag. Adjust the paths to match your project’s structure. Only directories and files included in the whitelist will appear in the coverage report.

...

File: test/phpunit/phpunit.xml

Code Block
languagexml
</php>
...
<source>
    <include>
        <directory suffix=".php">/var/www/totara/src/SITENAME/server/totara/core/classes/local</directory>
        <directory suffix=".php">/var/www/totara/src/SITENAME/server/totara/core/classes/task</directory>
        <file>/var/www/totara/src/SITENAME/server/totara/core/classes/visibility_adviser.php</file>
    </include>
</source>

...

Code Block
languagebash
sudo -- sh -c "echo \"127.0.0.1 coverage_report.totaraXX\" >> /etc/hosts"
  1. Now you should be able to access your coverage report via the web browser by navigating to http://coverage_report.totaraXX, where XX is the PHP version you used in step 2.

...