PHPUnit 13.1.0 Update: Enhanced Reporting & Coverage Options

PHPUnit, the essential testing framework for PHP applications, has released version 13.1.0. This minor update, dated 2026-04-03, focuses on refining test reporting, expanding code coverage customization, and improving overall stability. QA engineers tracking test automation tools will find several valuable enhancements in this release.

Key Changes

New Features: PHPUnit 13.1.0 introduces significant improvements to its reporting capabilities. The Open Test Reporting (OTR) XML logfile now provides more detail, including unexpected output, #[Group] information, and reported issues. This offers a more complete picture of test execution outcomes.

Code coverage reporting gains substantial flexibility. Users can now configure HTML code coverage report options such as colors, thresholds, and custom CSS directly within the XML configuration file. This includes support for dark mode, progress bar, and breadcrumb colors, allowing for highly tailored visual reports without needing to specify an output directory upfront. Additionally, a new includeInCodeCoverage attribute for <directory> and <file> elements under <source> provides granular control over what’s included in coverage analysis.

For advanced scenarios, custom issue trigger resolvers are now supported, configurable via <issueTriggerResolvers> in the XML file. The #[DataProviderClosure] attribute has been introduced for static closures, and EXPECTF sections now support %r...%r for more flexible pattern matching.

Improvements: Failure descriptions for the StringMatchesFormatDescription constraint (used by assertFileMatchesFormat(), assertStringMatchesFormat(), and EXPECTF sections) have been enhanced, making it easier to diagnose assertion failures. The default HTML code coverage report palette has been updated to a more colorblind-friendly blue/amber/orange scheme.

Deprecations: The --log-events-verbose-text <file> CLI option is now deprecated. id() and after() for mock object expectations are also soft-deprecated. QA teams should review their scripts and test setups to avoid reliance on these features in future versions.

Fixes: Several issues have been resolved, including problems with FILE_EXTERNAL breaking __DIR__, the absence of warnings for duplicate test runner extensions, brittle logic in TestSuiteLoader causing “Class not found” errors, and Process Isolation failures with non-serializable globals. These fixes contribute to a more stable and predictable testing environment.

Impact for QA Teams

This update provides QA teams with enhanced visibility into test results through richer OTR XML logs and clearer assertion failure messages. The extensive customization options for HTML code coverage reports allow for better visualization and analysis of test coverage, aiding in identifying untested areas. Overall, the fixes improve the reliability of test execution, reducing false negatives or environment-related issues.

FAQ

Q: What is the most significant change for test reporting in PHPUnit 13.1.0? A: The Open Test Reporting (OTR) XML logfile now includes unexpected output, #[Group] information, and reported issues, providing a more comprehensive test execution record.

Q: Can I customize the appearance of HTML code coverage reports? A: Yes, PHPUnit 13.1.0 allows extensive customization of HTML code coverage reports, including colors, thresholds, custom CSS, dark mode, and progress bar colors, all configurable via the XML configuration file.

Q: Are there any breaking changes QA engineers should be aware of? A: While this is a minor release, the --log-events-verbose-text CLI option and id()/after() for mock expectations have been deprecated. Reviewing test configurations and scripts for these deprecated features is recommended.

For installation details, refer to the official PHPUnit 13.1 documentation. Stay informed about PHPUnit’s development by following @phpunit@phpc.social or subscribing to the PHPUnit Updates newsletter.