PHPUnit 13.2 introduces several improvements focused on precision and clarity. New test ID mechanisms (--list-test-ids, --run-test-id, --test-id-filter-file) allow exact test selection without regex patterns, useful for CI sharding and re-running failures. Test ordering gains duration-descending support and cleaner deprecation of ambiguous ordering values. Diff generation is dramatically faster thanks to Myers' linear-space algorithm in sebastian/diff v9, reducing large-input diffs from tens of seconds to milliseconds. New --diff-context and --compact output options improve readability. Test doubles gain withParameterSetsInPartialOrder(), willReturnStrictMap(), and a clearer exception message API replacing the misleadingly named expectExceptionMessage(). The test runner also handles error handler chaining, output buffering conflicts, and graceful Ctrl-C interrupts more reliably.

8m read timeFrom phpunit.expert
Post cover image
Table of contents
Running exactly the tests you wantThe order tests run inFaster, clearer failuresA more dependable test runnerMore expressive test doublesExclusive insights delivered to your inbox
777 Impressions