Close-up of the used chart of a tachograph against a black background. The hours from 11 to 14 and speeds from 80 to 120 km/h are printed on the white, scratched paper, and between them the stylus has left a dense tangle of fine lines. A symbol of a record that states what happened during a journey, so that it can be checked later.

A process that runs PHPUnit learns one number from it, the shell exit code, and that number is 0 even when every test was skipped. PHPUnit 13.5 makes a test run something that can be checked. A receipt records what was run and how the run ended. --show-effective-configuration shows what a configuration will execute, without executing any of it. --random-seed gives a test the same random numbers again, however it is run. phpunit/php-code-coverage 14.6, which is released together with PHPUnit 13.5, no longer has to approximate which lines of a file are executable: on PHP 8.6, it can read them from the bytecode.

The exit code does not say whether your tests were run

Infection runs PHPUnit once for every mutant and counts the mutant as killed when PHPUnit does not report success. infection/infection#3769 shows what an ambiguous exit code costs such a tool. Since PHPUnit 13.3, the test runner can warn when PHP is not configured for development (#6853). Infection passes -d memory_limit=... to the processes it starts, and PHPUnit triggered that warning in each of them. The configuration that Infection generates for a mutant stops the test run at the first defect, and a warning of the test runner counts as one. PHPUnit therefore stopped before the first test and exited with 1. Infection reported every mutant as killed and a Mutation Score Indicator of 100 %, whatever the quality of the tests.

The maintainers of Infection asked for an exit code that is only used when a test fails. I wrote one: #7138 added the option --dedicated-exit-code-for-failed-tests, with which PHPUnit exits with 3 when, and only when, at least one test failed or errored. One of the maintainers of Infection reviewed the pull request with a table of 44 scenarios. That table shows what no exit code can say, and I closed the pull request because of it. 0 does not establish that the selected tests were run: no test matched the selection or every test was skipped, and at the time of the review 0 was also the exit code of a run that was interrupted and of one whose bootstrap script called exit(0). 1 does not say whether a test or the test runner triggered the issue that a failOn* setting matched. 124 hides that a test failed before the time limit was exceeded.

What 0, 1, and 2 mean stays as it is. The exit codes are the interface of the test runner that CI pipelines, scripts, and wrappers consume, and some of these compare the exit code against specific values. A test run that reaches its end and results in exit code 1 today must not result in a different one tomorrow. PHPUnit 13.5 changes the exit code of a test run that does not reach its end. When a bootstrap script, an extension, or a data provider calls exit(), PHPUnit reports a premature end, as it already did for a test, and exits with 2, also after exit(0). A test run that was interrupted with SIGINT exits with 130, whatever the result of the tests that were run until then. What the review asks for is a statement about the test run as a whole, among other things whether it completed, and PHPUnit had no place for such a statement.

PHPUnit 13.5 adds that place: the receipt of the test run (#7146). It is written whenever --log-otr, --log-json, --json, or --compact is used, and there is no option to request it. The tests of this class skip themselves when no database is configured:

<?php declare(strict_types=1);
namespace example;

use function getenv;
use PDO;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;

#[CoversClass(VoucherRepository::class)]
final class VoucherRepositoryTest extends TestCase
{
    private PDO $connection;

    protected function setUp(): void
    {
        $dsn = getenv('DATABASE_DSN');

        if ($dsn === false) {
            $this->markTestSkipped('DATABASE_DSN is not set');
        }

        $this->connection = new PDO($dsn);
    }

    public function testFindsVoucherThatWasAdded(): void
    {
        $repository = new VoucherRepository($this->connection);

        $repository->add('ABCD2345');

        $this->assertTrue($repository->has('ABCD2345'));
    }

    public function testDoesNotFindVoucherThatWasNotAdded(): void
    {
        $repository = new VoucherRepository($this->connection);

        $this->assertFalse($repository->has('ABCD2345'));
    }
}

On a machine where DATABASE_DSN is not set, the test run exits with 0. The receipt is the last record of the compact output:

$ phpunit --compact --testsuite integration
PHPUnit 13.5.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.6.0
Configuration: /path/to/project/phpunit.xml
Random Seed:   1795626080

OK (2 tests, 0 assertions, 2 skipped)

--- RECEIPT
Arguments: --compact --testsuite integration
Working directory: /path/to/project
Configuration: phpunit.xml (SHA-256: 68cc1475d7a2613b87b55bd6139e694d4cdf9f846e9e17ab7be723ab6f6f380f)
Bootstrap: tests/bootstrap.php
Started: 2026-11-25T17:01:20+00:00
Ended: 2026-11-25T17:01:20+00:00 (completed)
Duration: 0.009 seconds
Shell exit code: 0
Tests: 2 run, 0 assertions, 2 skipped

The receipt has two parts. The first one records what is being run: the version of PHPUnit and of PHP, the arguments, the working directory, the XML configuration file with the SHA-256 checksum of its contents, the bootstrap scripts, and the extensions. When PHPUnit is run from a PHAR, the path and the checksum of that PHAR are recorded as well. The compact output does not repeat the two versions, which it begins with, prints a path inside the working directory relative to it, and leaves out a line that has nothing to say, here the one for the extensions and the two for the issues. The second part records how the run ended: the exit code, the time it took to run the tests, the number of tests that were run and, of those, how many errored, failed, were skipped, were marked incomplete, or were considered risky, the number of assertions, and the numbers of issues. These numbers are taken from the result that the exit code is calculated from, so the receipt and the exit code cannot disagree about what happened.

The receipt records how the run ended as one of seven values. completed means that every selected test was run, which is also the case when no test was selected. stopped means that a stopOn* setting ended the run, and the receipt names the option that did, interrupted that a signal did, and time-limit-exceeded that the time limit configured with --timeout was exceeded. ended-prematurely means that the PHP process ended although PHPUnit did not end it, because a bootstrap script or a test called exit(), for instance, or because PHP raised an error that ends the process, and crashed means that an error occurred inside PHPUnit. not-started means that no test was run because the run could not be started, for instance because a code coverage report was requested and code coverage cannot be collected. The issues are counted separately for those that tests triggered and for those that the test runner triggered. The warning that stopped Infection's test runs belongs to the second group, and with the exit code alone it could not be told apart from a warning that a test triggered.

In the Open Test Reporting logfile, the subject of “What your test run already knows”, the first part is the phpunit:invocation element below infrastructure. It is written before the bootstrap script is loaded. The second part is the last thing PHPUnit writes, after the exit code is known:

<e:finished id="0" time="2026-11-25T17:02:02.561493Z">
 <attachments>
  <phpunit:outcome status="completed" shellExitCode="0" time="2026-11-25T17:02:02.561493Z" duration="0.003">
   <phpunit:tests run="2" assertions="0" errored="0" failed="0" skipped="2" incomplete="0" risky="0"/>
   <phpunit:issuesTriggeredByTests errors="0" deprecations="0" notices="0" warnings="0" phpunitErrors="0" phpunitDeprecations="0" phpunitNotices="0" phpunitWarnings="0"/>
   <phpunit:issuesTriggeredByTestRunner errors="0" deprecations="0" notices="0" warnings="0" phpunitErrors="0" phpunitDeprecations="0" phpunitNotices="0" phpunitWarnings="0"/>
  </phpunit:outcome>
 </attachments>
</e:finished>

PHPUnit also writes the second part when the test run does not reach its end, so a tool has to read its status. The logfile of a test run whose bootstrap script calls exit(0) is a complete document: its phpunit:outcome element has the status ended-prematurely and the exit code 2, and a phpunit:reason element in it says that the PHP process ended while the bootstrap script was loaded. The elements of PHPUnit in this logfile are now in the namespace https://schema.phpunit.de/otr/phpunit/0.6.0. In PHPUnit 13.4 it was 0.2.0, so a tool that reads any of these elements has to be adapted.

The receipt makes a result checkable, but not tamper-proof

The receipt is not a signature. It is written by the process that runs the test code, into a file and a stream that the test code can write to as well. In the compact output, a message or the output of a test that PHPUnit prints as part of a record is indented and cannot be mistaken for the receipt, which begins in the first column. Code that writes to the standard output stream without PHPUnit noticing, with fwrite(STDOUT, ...) for instance, can still imitate it.

A test run that does not reach its end has a complete receipt only when PHPUnit still gets to write it. After exit() in a bootstrap script or in a test, and after an error with which PHP ends the process, PHPUnit writes the second part with the status ended-prematurely. It sets memory aside when the test run starts, so that this also works after the memory limit was exhausted. An error inside PHPUnit leads to the status crashed. SIGKILL ends the process before the second part is written, and the logfile then ends after its last event, without being well-formed XML. When the CLI options or the XML configuration file are invalid, PHPUnit exits before the logfile is opened. A tool therefore has to make sure that it does not read the logfile of an earlier run, for instance by deleting it before it starts PHPUnit. The arguments are recorded as they were passed: a command line that contains a secret puts that secret into the logfile, into the JSON document, and into the compact output.

The receipt alone is not what Infection needs. #7148 describes what a mutation testing tool requires of a result: writing and parsing a logfile with the events of every test suite and test is work that repeats for thousands of mutants when only the last element is of interest, the compact output is made to be read and has no schema, and the numbers of failed and errored tests combine outcomes that Infection has to tell apart, such as a failed assertion, a failed fixture, and a child process that died.

My answer is the result of the test run in JSON format (#7198). --json replaces all output of PHPUnit with one JSON document on a single line, and --log-json writes the same document to a file. The document contains both parts of the receipt, the numbers of tests, and one entry in observations for everything that is not a test that passed. Tests that passed are counted and not listed, so the size of the document does not depend on the size of the test suite when nothing went wrong. An observation says whether a test or the test runner is its origin, in which phase it occurred, in setUp() or in the test method for instance, whether the throwable is a failed assertion, an exception, or an Error, how the child process of a test ended, and whether it makes the exit code different from 0. A tool decides on values from fixed lists and does not have to interpret the text of a message. Whether that is enough is for the maintainers of Infection to say. For subscribers of PHPUnit's events, I closed some of these gaps as well: the ChildProcessFinished and ChildProcessErrored events report the exit code of a child process or the signal that terminated it, and the Application\Finished event has an outcome() method that returns how the test run ended as the receipt records it.

The problem that Infection raised is what made me implement the receipt, and I consider it valuable whether or not Infection can use it. The other reader I had in mind is whoever checks the work of a CI pipeline or of a coding agent. An agent reports “all tests pass”, and until now nobody could verify afterwards which PHPUnit ran, with which arguments and which configuration, and whether tests were skipped to get there. The checksum of the configuration file tells you whether the run used the phpunit.xml you reviewed, and the arguments tell you whether a --filter or an --exclude-group narrowed what was run.

PHPUnit shows what a configuration executes before the test run

phpunit “only runs tests”, so it ends up on the list of commands that a coding agent may run without asking. Running PHPUnit executes code that the configuration names, though: the bootstrap script and the bootstrap scripts of test suites, the bootstrap classes of extensions, every PHAR in extensionsDirectory, and every test file that is selected, because a test file is loaded, and therefore executed, before the first test runs. The settings in <php> are applied even before the bootstrap script is included. The file that names all this is part of the repository the agent works on: a cloned project, a dependency, a pull request. The OWASP Top 10 for Agentic Applications names the two risks that meet here: ASI04 (Agentic Supply Chain Vulnerabilities) and ASI05 (Unexpected Code Execution).

Until now, what a configuration executes was invisible until the test run started. Reading phpunit.xml is not enough, because the effective configuration results from PHPUnit's defaults, the XML configuration file, and the CLI options together. Which test files are loaded also depends on prefixes and suffixes, on <exclude>, on phpVersion constraints, and on options such as --testsuite. The existing options did not help: --validate-configuration only checks the file against the schema, and --list-tests and its siblings include the bootstrap script, load the extensions, and load the test files, which is the code you wanted to inspect first.

--show-effective-configuration (#7038) prints the configuration that results from the three layers and exits before any of that code is touched. The output begins with what a test run with this configuration executes and where the test runner writes to: the bootstrap scripts, the extensions, the PHP configuration settings, the include paths, and the number of test files, followed by the files that are written, such as the test run history, logfiles, and code coverage reports. Below that, it lists every setting in alphabetical order, the test files of each test suite after all include and exclude rules have been applied, the source files, the source files excluded from code coverage, and the PHARs that would be loaded as extensions. The paths are resolved and sorted, so the output of two invocations can be compared. Outside the list of settings, a path inside the working directory is shown relative to it. Take a pull request that changes two places in phpunit.xml:

--- a/phpunit.xml
+++ b/phpunit.xml
@@ -12,9 +12,14 @@
         </testsuite>
         <testsuite name="integration">
             <directory>tests/integration</directory>
+            <directory suffix=".php">tests/support</directory>
         </testsuite>
     </testsuites>
 
+    <extensions>
+        <bootstrap class="vendor\reporting\Extension"/>
+    </extensions>
+
     <source>
         <include>
             <directory>src</directory>

This is the difference between the output of phpunit --show-effective-configuration --random-seed 1 for the two versions of the file:

--- main.txt
+++ pull-request.txt
@@ -5,10 +5,11 @@
 Executes:
   Bootstrap scripts:
     - tests/bootstrap.php
-  Extensions: (none)
+  Extensions:
+    - vendor\reporting\Extension
   PHP configuration settings: (none)
   Include paths: (none)
-  Test files: 2
+  Test files: 4
 
 Writes:
   Test run history: .phpunit.cache/test-run-history
@@ -103,7 +104,9 @@
   excludeTestSuite: ""
   executionOrder: random
   executionOrderDefects: default
-  extensionBootstrappers: (none)
+  extensionBootstrappers:
+    - className: vendor\reporting\Extension
+      parameters: (none)
   failOnAllIssues: false
   failOnDeprecation: false
   failOnDirectDeprecation: false
@@ -231,6 +234,8 @@
     - tests/unit/VoucherCodeTest.php
   integration:
     - tests/integration/VoucherRepositoryTest.php
+    - tests/support/DatabaseFixture.php
+    - tests/support/install.php
 
 Source files:
   - src/VoucherCode.php

The line with suffix=".php" looks like a detail of how test files are named. The effective configuration shows what it does: every PHP file below tests/support is now a test file, so the number of test files goes from two to four and install.php is loaded whenever this test suite is run. Both invocations get the same --random-seed because the seed of the test run is a setting, too, and the current time is used when none is given.

Two decisions keep this output from drifting away from what a test run does. The settings are found using reflection on the object that holds the configuration, so a setting that is added, changed, or removed is shown without changes to the command. That is also why their names are those of PHPUnit's internal representation: the directory configured with extensionsDirectory appears as pharExtensionDirectory. The lists of files are resolved by the same code that a test run uses, which I extracted from the code that builds the test suite for this purpose. Strings from the configuration are printed with control characters made visible, so a configuration file cannot hide or fake parts of the output.

This option does not make it safe to run tests you do not trust. Tests are arbitrary code, and isolating them is the job of a sandbox. When PHPUnit is installed with Composer, vendor/bin/phpunit includes vendor/autoload.php before any code of PHPUnit runs, which executes the files that the project and its dependencies list under autoload.files. Only the PHAR shows the configuration without loading code of the project first. Options that select tests based on what the test files declare, such as --filter and --group, appear as settings but are not applied to the list of test files, because that would require loading them. And the output does not say which of the three layers a value comes from.

One seed reproduces a test, however it is run

Code that calls mt_rand(), rand(), shuffle(), str_shuffle(), or array_rand() uses a random number generator whose state is global to the PHP process. Unlike a Random\Randomizer object, this state cannot be injected into the code under test. Such code gets different numbers in every test run, and a test that fails for some of them only cannot be made to fail again on purpose:

<?php declare(strict_types=1);
namespace example;

use function mt_rand;
use function strlen;

final class VoucherCode
{
    private const string ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';

    public static function generate(): string
    {
        $code = '';

        for ($i = 0; $i < 8; $i++) {
            $code .= self::ALPHABET[mt_rand(0, strlen(self::ALPHABET))];
        }

        return $code;
    }
}

mt_rand() includes its upper bound, so about one voucher code in five is a character short. The tests of this project are run in random order, and such a test run shows the seed it used:

$ phpunit --testsuite unit
PHPUnit 13.5.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.6.0
Configuration: /path/to/project/phpunit.xml
Random Seed:   1795626095

.F                                                                  2 / 2 (100%)

Time: 00:00.002, Memory: 22.00 MB

There was 1 failure:

1) example\VoucherCodeTest::testHasEightCharacters
Failed asserting that 'EELE9U3' matches PCRE pattern "/^[A-Z2-9]{8}$/".

...

With that seed, the test fails with the same voucher code when it is run on its own:

$ phpunit --random-seed 1795626095 --filter testHasEightCharacters
PHPUnit 13.5.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.6.0
Configuration: /path/to/project/phpunit.xml
Random Seed:   1795626095

F                                                                   1 / 1 (100%)

Time: 00:00.002, Memory: 22.00 MB

There was 1 failure:

1) example\VoucherCodeTest::testHasEightCharacters
Failed asserting that 'EELE9U3' matches PCRE pattern "/^[A-Z2-9]{8}$/".

...

Up to PHPUnit 13.4, this did not work. PHPUnit seeded the random number generator once, before it sorted the tests, and only when the tests were run in random order. The numbers that a test saw depended on everything that had consumed numbers before it: the shuffle() that put the tests into random order, the tests that ran earlier in the same process, and PHPUnit itself, which called mt_rand() for the class name of a test double. A test that was run on its own with --filter got other numbers than in the full test run. A test in a separate process and a data provider got other numbers in every test run, because the child process was not seeded at all and data providers are called before the tests are sorted.

PHPUnit 13.5 seeds the random number generators again before each test, before the before-first-test methods of each test class, and before each data provider is called (#7051). The seed for each of them is derived from the seed of the test run and from the test, the test class, or the data provider. A test therefore gets the same numbers regardless of which other tests are run, in which order, and whether it runs in a separate process. The class names of test doubles are now generated with random_bytes(), and the random order is shuffled by a Random\Randomizer with an engine of its own, so neither consumes numbers from the global state any more. The random number generator of the gmp extension is seeded as well, for the same reason as Mt19937: its state is global and cannot be injected.

The new option --random-seed <N> (#7049) sets the seed, whether or not the tests are run in random order. --random-order-seed is deprecated. Its name no longer describes what the seed is used for, and in PHPUnit 14 the examples of property-based tests will be generated from the same seed, so that one number is enough to reproduce a test run. PHPUnit only seeds when the tests are run in random order or when --random-seed is used, and only then does it print a seed that you can pass to the next test run.

This has a price: for the same seed, the order of the tests is the one that PHPUnit 13.4 produced, but the numbers that the tests see are different. Because the seed of a test is derived, mt_rand() in a test does not return what it returns after mt_srand(1795626095). A test that needs these numbers calls mt_srand() itself, and as PHPUnit seeds again before the next test, this no longer leaks into the tests that run after it. random_int() and random_bytes() are not seeded, and they should not be, because code relies on their numbers not being predictable. A Random\Randomizer uses the engine it was created with. Here I prefer the design over the seed: code that accepts a Random\Randomizer can be given one with a seeded engine by its test and does not need PHPUnit for that.

Executable lines are stated by the bytecode

Line coverage is a fraction. Xdebug and PCOV report the numerator, the lines that were executed. The denominator, the lines that can be executed, phpunit/php-code-coverage determines itself, so far from the syntax of each file. The syntax only allows for an approximation of the lines that PHP attributes code to. Take this class:

<?php declare(strict_types=1);
namespace example;

use function array_sum;
use function round;
use function sprintf;

final readonly class Invoice
{
    /**
     * @param list<float> $positions
     */
    public function __construct(
        private string $number,
        private array $positions,
        private float $taxRate,
    ) {
    }

    public function summary(): string
    {
        $net = array_sum($this->positions);

        return sprintf(
            'Invoice %s: %.2f net, %.2f gross',
            $this->number,
            $net,
            round(
                $net * (1 + $this->taxRate),
                2,
            ),
        );
    }
}

From the syntax, php-code-coverage counts eleven executable lines: the closing brace of the constructor on line 18, the assignment on line 22, and every line of the return statement from line 24 to line 32, down to the closing parentheses. This is what PHP compiles the constructor to:

example\Invoice::__construct:
     ; (lines=10, args=3, vars=3, tmps=0)
     ; (before optimizer)
     ; /path/to/project/src/Invoice.php:13-18
L0014 0000 CV0($number) = RECV 1
L0015 0001 CV1($positions) = RECV 2
L0016 0002 CV2($taxRate) = RECV 3
L0014 0003 ASSIGN_OBJ THIS string("number")
L0014 0004 OP_DATA CV0($number)
L0015 0005 ASSIGN_OBJ THIS string("positions")
L0015 0006 OP_DATA CV1($positions)
L0016 0007 ASSIGN_OBJ THIS string("taxRate")
L0016 0008 OP_DATA CV2($taxRate)
L0018 0009 RETURN null

The assignments to the promoted properties happen on lines 14 to 16. Line 18 only has the return that the compiler adds at the end of every function. On PHP 8.6, php-code-coverage 14.6 can read this instead of guessing it. For the class above it counts ten executable lines: 14 to 16, 22, 24, and 26 to 30. The closing parentheses on lines 31 and 32 and the line that only holds the format string have no opcode that both Xdebug and PCOV report, so they are not executable lines. The HTML report still shows such a line in the colour of its statement.

This is possible because, as of PHP 8.6, OPcache can dump the bytecode of a file with line numbers. The dumps in “How PHP executes bytecode” come from the same setting, opcache.opt_debug_level. php-code-coverage starts a separate PHP process without a configuration file, has OPcache compile, but not execute, the files, and reads the dump of the bytecode before it is optimised. A line is executable when it has an opcode that both Xdebug and PCOV report, other than the implicit return. All files whose analysis is not cached yet are compiled in one process, because starting a process takes much longer than compiling a file, and the results are cached separately for each version of PHP. A file that cannot be compiled is analysed based on its syntax, as before.

With Xdebug and PCOV, the bytecode is only used when the code that is executed is compiled the same way as the code that is analysed. That is the case when OPcache is enabled for the process that collects code coverage, compiles without optimisations, and does not skip recently modified files:

$ php -d opcache.enable_cli=1 \
      -d opcache.optimization_level=0 \
      -d opcache.file_update_protection=0 \
      vendor/bin/phpunit \
      --coverage-html build/coverage

Without these settings, the executable lines are determined from the syntax and nothing changes. The restriction exists because, when OPcache does not compile a file, PHP's compiler substitutes constants of classes that are already loaded, for instance, which changes the bytecode of a match expression. The lines that the driver reports would then no longer be the lines that were counted as executable.

Switching changes your numbers once. The class above goes from eleven executable lines to ten, with the same tests and the same code. If your pipeline enforces a threshold or compares code coverage with that of the previous build, expect that difference on the day you change the settings.

The HTML report leads to the code that is not covered

Next to a line that is covered, the HTML report now shows how many tests cover it. Until now, you had to open the popover of a line, which lists these tests, to find out. A line that a single test covers and a line that hundreds of tests cover looked the same otherwise.

The n and p keys, and two buttons, jump to the next and to the previous piece of code that is not covered. In the views for branch coverage and path coverage, lines that are only partially covered are included. In a long file with a few uncovered lines, this replaces scrolling and looking for red. A directory that contains nothing but another directory, or nothing but a single file, is now listed together with what it contains, Report/Html/Renderer for example, instead of requiring a click for each level. The same applies to a namespace that contains nothing but another namespace.

The view for branch coverage, which I described in the article on PHPUnit 13.3, answers a more precise question than before. Next to a line that a branch with more than one successor ends on, it shows which of the edges out of that branch were taken. Previously, it showed whether the branches that these edges lead to were executed, and only for one such branch per line. A branch can be reached over more than one edge, so the old display could show a decision as covered although no test had taken that way out of it. This release also fixes that the edges taken were only recorded for the first test that executes a function.

What PHPUnit 14 removes, PHPUnit 13.5 already reports

PHPUnit 13.5 is the last feature release before PHPUnit 14 in February, and three things now trigger a deprecation. The first is --random-order-seed: replace it with --random-seed in scripts and in the configuration of your pipeline. The second is the extensionsDirectory attribute of the XML configuration file, from which PHPUnit loads every PHAR it finds as an extension of the test runner. Install the extension with Composer or load its PHAR in your bootstrap script instead. The third is calling markTestSkipped() or markTestIncomplete() after a test has run, in tearDown() or tearDownAfterClass(). Today, a test that passed is reported as skipped when tearDown() calls markTestSkipped(), and the same call in tearDownAfterClass() has no effect at all. Skip a test in setUpBeforeClass(), in setUp(), or in the test method instead.

One change takes effect right away. The version requirements of #[RequiresPhp], #[RequiresPhpExtension], and #[RequiresPhpunit] are now handled by sebastian/version-requirement. A requirement has to be a version constraint such as ^8.5 or a version comparison such as >= 8.5.0, and a test whose requirement is neither now errors. Until now, PHPUnit made something of such a string without telling you: >=8.3 <8.5 was interpreted as < 8.5, so a test that was meant for two versions of PHP also ran on every older one, and 8.5-dev was interpreted as 8.5.*. I consider the error the better answer, because a requirement that PHPUnit reads differently than you wrote it silently decides whether a test runs.

The three big changes in PHPUnit 14 need your test suite now

PHPUnit 14 will be released on 5 February 2027 with three big changes: parallel test execution, test impact analysis, and property-based testing. All three are implemented and documented, and I ask you to try them with your test suite before the release. Report what does not work, what surprises you, and what the documentation leaves open, because until the release I can still act on it.

The development version requires PHP 8.5. Composer installs it when your composer.json sets minimum-stability to dev and prefer-stable to true, and requires phpunit/phpunit in version ^14.0. minimum-stability is needed because the development version requires dependencies in versions that have not been released yet either, and prefer-stable keeps all others at stable releases. What PHPUnit 13.5 reports as a deprecation has already been removed from the development version. So get your test suite to run without deprecations on PHPUnit 13.5 first.

Parallel test execution distributes the test classes among several PHP processes. --parallel auto starts one worker for each CPU core that is available and requires no change to the configuration. Tests that pass when they are run one after another can fail when they are run in parallel, because they write to the same database table or the same file, or listen on the same port. The documentation describes how a test uses the environment variable PHPUNIT_WORKER_ID to select a resource that it shares with no other worker, and how #[DoNotRunInParallel] exempts a test from being run in parallel.

Test impact analysis runs only the tests that can be affected by a change. A test run with --record-test-impact-data records what each test depends on. For this, PHPUnit needs a cache directory, a <source> element in the XML configuration file, and PCOV or Xdebug. After that, --only-impacted runs only the tests that can be affected by what changed since the recording, and --explain-impacted shows which ones these are, and why, without running a test. Compare this selection with the one you expect for your next changes.

Property-based testing is the only one of the three changes that you have to write a new test for. The #[Property] attribute turns a test method into a property: PHPUnit derives the generators for its parameters from their types, calls the method with 100 generated examples, and shrinks an example that falsifies the property to a simpler one. The examples are generated from the seed of the test run, so --random-seed reproduces them as well.

Every two months, alongside each PHPUnit feature release, I write a detailed walkthrough of the new features: what they do, how they are implemented, and why they were added. It is the context that the ChangeLog does not cover.