WordPress-Coding-Standards/phpunit.xml.dist
jrfnl bb305f8768
Tests: allow for PHPUnit 8/9
PHP_CodeSniffer 3.8.0 now allows for running the tests, which are based on the PHPCS native test suite, with PHPUnit 8 and 9.

This commit updates the package to take advantage of that.

Includes:
* Widening the PHPUnit version requirements.
* Adding the PHPUnit 8+ cache file to `.gitignore`.
* Updating the PHPUnit configuration to make sure that deprecations will always show, even when on a high PHPUnit 9.6 version.
* Updating the info in `CONTRIBUTING`.
* Simplifications to the `quicktest` and `test` workflows.
    Also, the code coverage "high" run can now be run against PHP 8.3.
* Running PHPStan against PHP `latest` (couldn't previously be done due to the old PHPUnit version).
* Minor tweak to the PHPStan config to make sure PHP 8.x specific issues don't get flagged for this codebase.
* Removing a no longer needed `--ignore-platform*` argument.
* Updating the "setUp" method in one test to call the parent "setUp" method via the new method name.

Ref:
* PHPCSStandards/PHP_CodeSniffer 59
2023-12-11 14:15:45 +01:00

38 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="true"
bootstrap="./Tests/bootstrap.php"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertDeprecationsToExceptions="true"
beStrictAboutTestsThatDoNotTestAnything="false"
colors="true"
forceCoversAnnotation="true">
<testsuites>
<testsuite name="WordPress">
<directory suffix="UnitTest.php">./WordPress/Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="false">
<file>./WordPress/Sniff.php</file>
<file>./WordPress/AbstractArrayAssignmentRestrictionsSniff.php</file>
<file>./WordPress/AbstractClassRestrictionsSniff.php</file>
<file>./WordPress/AbstractFunctionParameterSniff.php</file>
<file>./WordPress/AbstractFunctionRestrictionsSniff.php</file>
<directory>./WordPress/Sniffs/</directory>
<directory>./WordPress/Helpers/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>