E
E
egorggegor2021-08-18 10:46:17
PHPUnit
egorggegor, 2021-08-18 10:46:17

How to fix phpunit.xml config file?

Hello.

There is the following configuration file for PHP 8.0.9, phpunit 9.5.8 :
611cb98dd2098892954876.png

When running tests with the command , the vendor/bin/phpunit
following error is displayed:
611cba6f93b80821724320.png

As I understand that phpunit was removed in this version <filter>, I need to write something else.

Thanks for answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HellWalk, 2021-08-18
@HellWalk

Here is an example of a working phpunit.xml:

<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./vendor/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Test Suite">
            <directory>./tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">./src/</directory>
        </whitelist>
    </filter>
</phpunit>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question