PHPUnit 13.2.0 Update: Enhanced Control, Assertions & Reporting

Release Type: minor | Date: 2026-06-05 | Category: Test Automation

Key Changes

  • Test Execution & Control: PHPUnit 13.2.0 significantly enhances test execution control. New CLI options like --run-test-id <test-id> allow for executing a single, precisely identified test, while --list-test-ids helps discover available test IDs. The --filter option is also enhanced to support this ID syntax. For managing test runs, the executionOrder attribute in the XML configuration now offers greater flexibility, including sorting by descending duration to quickly pinpoint performance bottlenecks. Furthermore, new thresholds for --stop-on-defect, --stop-on-error, and similar options provide finer control over when a test suite should halt, improving efficiency in CI/CD pipelines. The ability to handle interrupts and display current test results (#4201) also improves feedback during long test runs.
  • Enhanced Assertions & Reporting: Testers gain new assertStringEqualsIgnoringWhitespace() and assertStringContainsIgnoringWhitespace() methods, crucial for comparing multi-line strings or outputs where whitespace variations are irrelevant. Failure messages for basic constraints (IsTrue, IsFalse, IsNull) are now cleaner, avoiding verbose object and array dumps, which simplifies debugging. Reporting is significantly upgraded with a --compact CLI option for concise console output. The Open Test Reporting XML format is enriched with per-test and per-test-suite resource usage (time, memory, peak memory), assertion counts, structured comparison failure details (expected, actual, diff), and even the random order seed when tests are randomized, providing deeper insights for analysis.
  • Code Quality & Coverage: The update introduces an option (#4501) to mark tests as risky if they do not contribute to code coverage, encouraging more meaningful and effective tests. PHPT tests are also flagged as risky when their --SKIPIF-- section lacks standard-output side effects (#6000). For more granular coverage analysis, the configuration for branch coverage can now be separated from path coverage (#6602), allowing QA teams to focus on specific aspects of code execution.
  • Usability & Configuration: A new --validate-configuration CLI option helps ensure XML configuration files are correctly set up, preventing runtime errors due to malformed settings. Warnings are now emitted for conflicting CLI options (#6346), guiding users towards correct usage. Additionally, the ability to configure diff context lines (#6567) improves readability of comparison failures, and the --disable-coverage-targeting option (#6598) offers more control over coverage collection.

Impact for QA Teams

These updates empower QA teams with more granular control over test execution and significantly improved reporting capabilities. The new assertions and coverage features help write more effective tests and identify potential issues faster, leading to more efficient debugging and higher quality releases.

For the full changelog, refer to the official PHPUnit release notes.