phpunit-testingphpunitwarnings

PHPUnit warning - No filter is configured, code coverage will not be processed


I'm trying to generate coverage html file with PHPUnit. I get a warning: 'No filter is configured, code coverage will not be processed' and coverage file isn't generated.

This is phpunit.xml file

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
  <testsuites>
    <testsuite name="Application Test Suite">
      <directory>./phpUnitTutorial</directory>
    </testsuite>
  </testsuites>
</phpunit>

Can anyone help?


Solution

  • I suggest you use the configuration generator (phpunit --generate-configuration). It will ask you a couple of questions and then generate the right configuration for you.