sebastianbergmann / phpunit-documentation-english

English Documentation for PHPUnit
https://docs.phpunit.de/
87 stars 137 forks source link

Improve documentation of handling of deprecations, notices, and warnings #384

Open 8ctopus opened 2 days ago

8ctopus commented 2 days ago

I’m testing my packages for compatibility with PHP 8.4.1 and some dependencies trigger deprecation warnings.

Is there a way to configure PHPUnit to report deprecation warnings only for my package and ignore those from dependencies? In other words, ignore all deprecations within the vendor dir?

sebastianbergmann commented 2 days ago

Yes, this is possible. Unfortunately, not everything that is possible is already documented (well enough), but the some documentation is available here.

For the most common use case, you want to have this in your phpunit.xml configuration file:

<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
    <include>
        <directory>src</directory>
    </include>
</source>
8ctopus commented 2 days ago

Thank you!