0

When generating code coverage through Xdebug (PHP), it always asks me to configure the filter, however when editing phpunit.xml, it tells me that filter is an unexpected element.

Current:

<phpunit bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false">
    <coverage>
        <report>
            <text outputFile="coverage.txt"></text> <!-- Salida en consola a un archivo 'coverage.txt' -->
            <clover outputFile="coverage.xml"></clover> <!-- Informe XML de cobertura a 'coverage.xml' -->
        </report>
    </coverage>
    <testsuites>
        <testsuite name="Trabajo Final">
            <directory>Pruebas Unitarias</directory> <!-- Directorio con tus pruebas unitarias -->
        </testsuite>
    </testsuites>
</phpunit>
Problem:
 Line 7:
Element 'filter': This element is not expected.

Where do I configure the filter?

I already tried every thing I could without breaking it again.

2
  • 1
    Which PHPUnit version are you using? Is this the entire phpunit.xml? Commented Nov 24, 2024 at 19:22
  • You don't even have the word "filter" in your XML code, so you must be editing the wrong file. Beware that in some cases projects distribute a template which PHPUnit doesn't read, it's just used to generate the file that PHPUnit does read. Also, how do you invoke the phpunit command? Is it possible that it's a wrapper script that adds its own parameters? Commented Nov 25, 2024 at 8:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.