NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #41 most downloaded on Packagist
The PHP Unit Testing framework.
Latest stable
13.4.8
Last release 3 days ago
19 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
868 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
The baseline generated using --generate-baseline contains an issue once for each time it was triggered, for instance once for each data set of a test
--generate-baseline contains an issue once for each time it was triggered, for instance once for each data set of a test that uses a data provider, instead of oncebuild/baseline.xml and the file in src--log-junit php://stdout is used, or php://stdout is configured for the JUnit XML logfile in the XML configuration file, and the test runner prints its regular output, the test runner ends with An error occurred inside PHPUnit after the JUnit XML was printed: the test results are not printed, code coverage reports and the baseline are not written, and the shell exit code is 255--log-junit php://stdout is used together with --stderr, the JUnit XML is printed to the standard error stream--compact only prints No tests executed! and not why, for instance the PHPUnit error for the invalid data provider of the only test, or the test runner warning for a test class without testsLearn how to install or update PHPUnit 13.4 in the documentation.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
…for instance default,random , triggers a deprecation for using more than one order, although default resets the order instead of selecting one
--order-by random, defects configured using the executionOrder attribute in the XML configuration file is still applied, and vice versadefault together with an order for --order-by or the executionOrder XML configuration attribute, for instance default,random, triggers a deprecation for using more than one order, although default resets the order instead of selecting one--fail-on-skipped does not make the test runner exit with a shell exit code that indicates failure when a test class is skipped, for instance because its before-first-test method calls markTestSkipped(), although its tests are counted as skipped--stop-on-skipped does not stop the test run when a test class is skipped, for instance because its before-first-test method calls markTestSkipped()PHPUnit\ or SebastianBergmann\ namespace that do not belong to PHPUnit or one of its dependencies are preloaded on startup, which leads to a fatal error when such a code unit depends on code that is not availablesebastian/file-filter and sebastian/git-state is not treated like code from PHPUnit's other dependencies, for instance stack frames from it are not filtered from stack tracesnikic/php-parser and parts of the code from phar-io/manifest are not treated like code from PHPUnit's other dependencies, for instance stack frames from it are not filtered from stack tracesLearn how to install or update PHPUnit 13.4 in the documentation.
Issues whose message refers to an anonymous class could not be ignored using a baseline on PHP 8.6 (as of PHP 8.6, such messages contain the full name
method() is called for a method of a test double that cannot be configured, for instance because it does not exist, every subsequent invocation of a method of that test double fails with Method name is not configuredsetUp(), marks the test as incomplete, the hook method is reported as failedtearDown(), marks a successful test as incomplete or skips it, the test is reported as failedsetUpBeforeClass(), calls markTestIncomplete(), each test of the test class is reported as failed instead of the test class being skipped as it is when markTestSkipped() is calledtearDownAfterClass(), calls markTestIncomplete() or markTestSkipped() after the tests of the test class have been run, this is reported as a failure, also for each test of the test class that is run in process isolationassert(), in a hook method is reported as an error of that method instead of as a failure, and it is counted as an error instead of as a failure when that method is a before-first-test method or an after-last-test methodtearDown(), of a test that already failed, errored, or was marked as incomplete, a failure is reported in addition to the outcome of the test, so the test is counted more than once and onNotSuccessfulTest() is called with the failure from the "after test" method instead of the test's owntearDown(), is reported in addition to the test's failure, so the test is counted more than oncerequireCoverageMetadata="true" is configured, when it does not define a code coverage target, unlike a test that fails because an assertion failedsetUpBeforeClass()--debug and in the logfiles written by --log-events-text and --log-events-verbose-textgroups attribute of <directory> or <file> in the XML configuration file are not assigned to PHPT tests, so --group and --exclude-group do not select them and --list-groups and --list-tests-xml report them as being in the default group or not at allphpunit-library-X.Y.Z.phar) is no longer built, it could not be loaded since PHPUnit 9.5.8Learn how to install or update PHPUnit 13.4 in the documentation.
The static analysis cache directory that is automatically created in the operating system's path used for temporary files when no cache directory is c
Learn how to install or update PHPUnit 13.4 in the documentation.
The TeamCity logger writes testSuiteFinished twice for a test class when one of its before-first-test methods errors or fails
testSuiteFinished twice for a test class when one of its before-first-test methods errors or failstearDown() of a test that erroredLearn how to install or update PHPUnit 13.4 in the documentation.
The dependencies of a test that are listed after a dependency on a test that does not return a value, or after a dependency on a larger test, were not
CodeCoverage or Facade#[Before] method, skips the test, the remaining hook methods of the same kind are still called, so the test is reported as errored instead of skipped when one of them errorsE for the test class instead of one for each of its tests, only one of its tests is counted as run, and the test that is run next is shown as an errorsetUp(), and reports the test that is run after it as aborted with the message of the incomplete testsetUp() raises an exception or the global state cannot be backed uptearDown() fails after the test errored, with its last outcome instead of its most severe one, and with more than one end when the preparation of the test errored]]>, bytes that are not valid UTF-8, or characters that are not allowed in XML, for instance the escape character of an ANSIsetUp(), with an empty ID before the start of the testLearn how to install or update PHPUnit 13.4 in the documentation.
expectUserDeprecationMessage() and expectUserDeprecationMessageMatches() did not see the deprecations triggered by an attempt of a retried test and sa…
expectUserDeprecationMessage() and expectUserDeprecationMessageMatches() did not see the deprecations triggered by an attempt of a retried test and saw those of the previously run test instead#[Retry] does not retry the test, --repeat does not skip the remaining repetitions, tearDown() sees the wrong status, and code coverage records the test as successfulwith() were matched by position instead of by name, so an expectation such as ->with(b: 7) compared the expected value with the first parameter of the method and the parameter named $b was not checkedwithParameterSetsInOrder(), withParameterSetsInAnyOrder(), and withParameterSetsInPartialOrder() were ignored, so a parameter set such as ['b' => 7] compared the expected value with the first parameter of the method and the parameter$b was not checkedLearn how to install or update PHPUnit 13.4 in the documentation.
The Software Bill of Materials (SBOM) embedded in the PHAR now uses CycloneDX 1.7 and provides the NTIA minimum elements as well as the data fields th
TestSuite::runTests() doubles garbage collector time when zend.exception_ignore_args is offsetUpBeforeClass() and tearDownAfterClass() were run twice for a test class that is the only test class in a test suite of the XML configuration file that has the name of that test class--ARGS-- section of a PHPT test that start with - were interpreted by PHP instead of being passed to the test when the test also has a --STDIN-- sectionLearn how to install or update PHPUnit 13.4 in the documentation.
--coverage-jsonl CLI option and <jsonl> element for the XML configuration file to write a code coverage report in JSONL format, one JSON object per li
executionOrder attribute values and --order-by token lists that spell the order before defects, for example duration-ascending,defectspipeline() on the TestSuite\Sorted event for inspecting which reordering stages were appliedConstraint::negatedToString() and Constraint::negatedFailureDescription() for authoring the description of a constraint that is wrapped in LogicalNot#[RequiresClass] attribute to skip a test if a class does not existChildProcessExtension interface for extensions that need to be bootstrapped in the child process of a test that runs in process isolation--coverage-jsonl CLI option and <jsonl> element for the XML configuration file to write a code coverage report in JSONL format, one JSON object per line, that reports uncovered code rather than every executable line--timeout CLI option to limit the wall-clock time of the entire test runrequireCoverageMetadataOnSmallTests, requireCoverageMetadataOnMediumTests, and requireCoverageMetadataOnLargeTests attributes for the XML configuration file to require code coverage metadata depending on the size of a test; these have precedence over requireCoverageMetadata--- OUTPUT: record that is attributed to the test instead of being passed through unformatted; the record is omitted when beStrictAboutOutputDuringTests or --disallow-test-output already reports the output as riskydefects before the order for --order-by and executionOrder, which will change meaning in PHPUnit 14depends and no-depends for --order-by and executionOrder--order-by and executionOrderexecutionOrder XML configuration attribute, which are currently ignoredConstraint::failureDescriptionInContext() and LogicalNot::negate()#[Group], #[Ticket], #[Small], #[Medium], and #[Large] on parent classes of test classes#[DataProviderClosure] errors when it is run in process isolationLearn how to install or update PHPUnit 13.4 in the documentation.
The first attempt of a test that is retried is reported as attempt 1 of 1 in events, instead of attempt 1 of the configured maximum number of attempts
#[RequiresMethod] is declared as class-string, so static analysis reports an error when it refers to a class that does not exist#[RequiresMethod] attribute that refers to a class which cannot be loaded, for instance because its parent class does not exist, aborts the test run instead of skipping the testLearn how to install or update PHPUnit 13.3 in the documentation.
Control characters and ANSI escape sequences in user-supplied strings such as test names, data set names, and messages are now made visible as \u{NNNN
\u{NNNN} escape sequences instead of being passed through to the terminalLearn how to install or update PHPUnit 13.3 in the documentation.
The compact output displays details on PHPUnit deprecations and PHPUnit notices even when --display-phpunit-deprecations and --display-phpunit-notices…
SourceMapper may be deleted prematurely--display-phpunit-deprecations and --display-phpunit-notices are not usedLearn how to install or update PHPUnit 13.3 in the documentation.
Paths of included files are now escaped when generating the code that is executed in a separate process, so that a path containing special characters
Learn how to install or update PHPUnit 13.3 in the documentation.
Learn how to install or update PHPUnit 13.3 in the documentation .
SourceMap is built in child process even though identifyIssueTrigger is disabled#[CoversFile] attribute is not considered for risky test checkLearn how to install or update PHPUnit 13.3 in the documentation.
Invoking a static hook method such as setUpBeforeClass() no longer triggers a deprecation warning on PHP 8.6
setUpBeforeClass() no longer triggers a deprecation warning on PHP 8.6Learn how to install or update PHPUnit 13.3 in the documentation.
phpunit/php-code-coverage #1140 : Class-oriented HTML report
--repeat CLI option and #[Repeat] attributeexpectOutputString() and expectOutputRegex() to be combined and repeated#[CoversNothing] on methods--retry CLI option #[Retry] attributefailOnAllIssues="true" is combined with an explicitly disabled fine-grained failOn* setting--record-test-run-history and --do-not-record-test-run-history CLI options as well as the recordTestRunHistory attribute for the XML configuration file to control whether the status and duration of each test are recorded for use by --order-by defects and --order-by duration-*--without-class-view CLI option and classView attribute for the XML configuration file to disable the class-oriented view in the HTML code coverage report--without-file-view CLI option and fileView attribute for the XML configuration file to disable the file-oriented view in the HTML code coverage report{PWD} is now substituted with the directory of the PHPT test file in --ENV-- and --INI-- sections of PHPT test files{TMP} (system directory for temporary files) and {ENV:name} (value of environment variable name) are now substituted in --INI-- sections of PHPT test files--INI-- section references an environment variable that is not set is now skipped--SKIPIF-- section of a PHPT test file that prints xfail <reason> now marks the test as expected to fail, as if the PHPT test file had an --XFAIL-- section with that reasontest-run-history instead of test-resultsTestCase no longer captures error_log() output for tests that do not use expectErrorLog(), avoiding the cost of setting up error log redirection for every testerror_log() output from tests without an expectation is no longer echoed (date-stripped) to PHPUnit's output; it goes to the configured error log again, as it did before capture was introducederror_log() without expectErrorLog() now produces stderr output in the child process, which the test runner reports as a test error--XFAIL-- section or xfail output from the --SKIPIF-- section) but passes is now considered risky; this usually means the expected-failure marker is stale and should be removed--SKIPIF-- section produces output that is not recognized is now considered risky; this usually means the skip check itself is broken. The keywords understood by PHP's own test runner that have no PHPUnit counterpart (info, warn, xleak, flaky, and nocache) are tolerated and do not make the test riskydate.timezone=UTC, display_startup_errors=1, fatal_error_backtraces=Off, ignore_repeated_errors=0, precision=14,serialize_precision=-1), consistent with PHP's own test runner; all of them can be overridden per test using the --INI-- section--cache-result CLI option, use --record-test-run-history instead--do-not-cache-result CLI option, use --do-not-record-test-run-history insteadcacheResult XML configuration attribute, use recordTestRunHistory insteadPHPUnit\TextUI\Configuration\Configuration::cacheResult(), use PHPUnit\TextUI\Configuration\Configuration::recordTestRunHistory() insteadPHPUnit\TextUI\Configuration\Configuration::testResultCacheFile(), use PHPUnit\TextUI\Configuration\Configuration::testRunHistoryFile() insteadexpectErrorLog() now only considers error_log() output written after it was called; previously, the expectation was also satisfied by output written before expectErrorLog() was called--FILE--, --FILEEOF--, and --FILE_EXTERNAL-- sections, or more than one expectation section (--EXPECT--, --EXPECTF--, --EXPECTREGEX--, and their _EXTERNAL variants) are now rejected; previously, misspelled sections were silently ignored and duplicated sections silently overwrote each other--EXPECTREGEX-- section must now match the PHPT test's entire output, and . now matches newline characters, consistent with PHP's own test runner; previously, a match on a substring of the output was sufficient for the test to pass--SKIPIF-- section of a PHPT test is no longer mangled when it follows the skip <reason> convention used by PHP's own test suite; previously, the first two characters of the reason were stripped unless the skip: <reason> or skip - <reason> convention was usedPHPUnit\Runner\Phpt\InvalidPhptFileException when a PHPT test file has an empty --FILE-- or --FILEEOF-- section or a --FILE_EXTERNAL-- section that references an empty file; such a file is now rejected while it is parsed and reported as an errored testPHPUnit\Runner\Phpt\InvalidPhptFileException now has a message that explains why the PHPT test file was rejectedLearn how to install or update PHPUnit 13.3 in the documentation.
Regression that stopped test methods from being sorted by source code location
Learn how to install or update PHPUnit 13.2 in the documentation.
Messages for tests that are skipped because of an unsatisfied RequiresPhp , RequiresPhpunit , or RequiresPhpExtension version requirement now include
RequiresPhp, RequiresPhpunit, or RequiresPhpExtension version requirement now include the version that is actually being used@ error suppression and forwards suppressed warnings to previous error handlerassertArrayHasKey() does not accept ArrayAccess implementations with a specific value type when test code is analysed with PHPStan at level 9Learn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.2 in the documentation .
error_reporting() output dynamicallyLearn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.2 in the documentation .
Learn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.2 in the documentation.
--filter matches the name of a data set but not the name of the test methodLearn how to install or update PHPUnit 13.2 in the documentation.
Only errors and failures are now considered for "defect first" test reordering (tests that triggered deprecations, notices, or warnings as well as inc…
IsTrue, IsFalse, IsNull, IsFinite, IsInfinite, and IsNan constraints#[RunTestsInSeparateProcesses] from parent test classesassertContainsEquals() should use sebastian/comparator for element comparison--SKIPIF-- does not have standard-output side effect$_dataName available to #[TestDoxFormatter] callbacks$skipWhenEmpty parameter for #[DataProvider] and #[DataProviderExternal]--stop-on-defect, --stop-on-error, etc. to accept an optional thresholdwillReturnMap() with constraint support and strict matching--list-test-ids CLI option and enhance --filter CLI option to support test ID syntax--run-test-id <test-id> CLI option that accepts a single test ID for exact matching--compact CLI option and PHPUNIT_COMPACT_OUTPUT=1 environment variable)--disable-coverage-targeting CLI optionexecutionOrder attribute in the XML configuration file now accepts defects combined with any main order, as well as three-way combinations of depends/no-depends, defects, and a main order (for example, depends,defects,duration-ascending)--validate-configuration CLI option to validate an XML configuration file for PHPUnitsebastian/file-filter in SourceFilter::includes() for issue trigger identification#[IgnoreDeprecations] to be repeated--filterIsEqual, IsEqualCanonicalizing, IsEqualIgnoringCase, IsEqualWithDelta, and TraversableContainsEqual constraints or the assertEquals(), assertEqualsCanonicalizing(), assertEqualsIgnoringCase(), assertEqualsWithDelta(), and assertContainsEquals() assertions--order-by duration CLI option, use --order-by duration-ascending instead--order-by size CLI option, use --order-by size-ascending insteadexecutionOrder="duration" XML configuration attribute value, use executionOrder="duration-ascending" insteadexecutionOrder="size" XML configuration attribute value, use executionOrder="size-ascending" insteadexpectExceptionMessage(), use expectExceptionMessageIsOrContains() insteadauto_prepend_file) cause false "risky test" warningsTestSuiteSorter::cmpSize() does not handle TestSuite objects for TestCase classesLearn how to install or update PHPUnit 13.2 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
assertNotEquals() failure message says "is equal to" instead of "is not equal to" when comparing arrays or objectsexpectOutputString() and expectOutputRegex() silently replace themselves and each otherLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
assertXmlStringEqualsXmlString() regressed into treating comments as significantLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
-d settings forwarded to child processes (breaks PCOV coverage)Learn how to install or update PHPUnit 13.1 in the documentation.
PHP setting values containing = need to be quoted before forwarding via -d
= need to be quoted before forwarding via -dLearn how to install or update PHPUnit 13.1 in the documentation.
Pass configuration options introduced in sebastian/diff 8.3.0
Learn how to install or update PHPUnit 13.1 in the documentation.
A Test or Tests prefix is no longer stripped from class names when they are processed for TestDox output
Test or Tests prefix is no longer stripped from class names when they are processed for TestDox outputLearn how to install or update PHPUnit 13.1 in the documentation.
MockBuilder::setMockClassName() and TestStubBuilder::setStubClassName() now reject values that are not valid unqualified PHP class identifiers, throwi
testStarted and testFinishedassertArrays*IgnoringOrder() fails on mixed scalar types and on reordered nested associative arraysMockBuilder::setMockClassName() and TestStubBuilder::setStubClassName() now reject values that are not valid unqualified PHP class identifiers, throwing the new InvalidClassNameExceptionGenerator::ensureValidMethods() to validate method names passed to MockBuilder::onlyMethods() and addMethods() was not anchored, so any string containing a valid identifier substring (including strings with parentheses, braces, comments, or newlines) was acceptedLearn how to install or update PHPUnit 13.1 in the documentation.
Pass LIBXML_NONET when parsing/validating XML configuration files to make explicit that no network I/O is performed
LIBXML_NONET when parsing/validating XML configuration files to make explicit that no network I/O is performedLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
; and " are not preserved when forwarding settings to child processesLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
-d settings are not forwarded to child processes for process isolationRequiresPhp (e.g. <=8.5) is compared against full PHP version, causing unexpected skipsdataSetAsStringWithData() raises "float is not representable as int" warning for large floats in data setsLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
DefaultJobRunner deadlocks on child processes that write large amounts of stderr output$_SERVER entries leak from parent into child processfailOnEmptyTestSuite="false" in phpunit.xml is ignored when --group/--filter/--testsuite matches no testsLearn how to install or update PHPUnit 13.1 in the documentation.
Regression in XML configuration migration introduced in PHPUnit 12.5.8
Learn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
--random-order-seed is used when test execution order is not random--filter does not work when filter string starts with #TestSuiteSkipped event--filter, --group, --testsuite) yields no teststearDown() and handler restoration, causing subsequent tests to be marked as riskyLearn how to install or update PHPUnit 13.1 in the documentation.
Learn how to install or update PHPUnit 13.1 in the documentation.
exit was called from some testcolors="true" in XML configuration file does not unconditionally enable colored output--migrate-configuration does not update schema location when XML content already validates against current schemawillReturnCallback() is silently swallowed when code under test catches exceptionsset_include_path()TestDoubleBuilder method chainingLearn how to install or update PHPUnit 13.1 in the documentation.
Support for configuring HTML code coverage report options (colors, thresholds, custom CSS) in XML configuration file without requiring an outputDirect
includeInCodeCoverage attribute for <directory> and <file> children of <source>#[Group] information in Open Test Reporting (OTR) XML logfile#[DataProviderClosure] for static closures<issueTriggerResolvers> in the XML configuration file%r...%r in EXPECTF sectionoutputDirectory attribute, allowing the output directory to be specified later with the --coverage-html CLI optionStringMatchesFormatDescription constraint which is used by assertFileMatchesFormat(), assertFileMatchesFormatFile(), assertStringMatchesFormat(), assertStringMatchesFormatFile(), and EXPECTF sections of PHPT test filesPHPUnit\Runner\Extension\Facade from a concrete class to an interface and introduced an internal ExtensionFacade implementation, so that extensions only depend on the Facade interface while PHPUnit internally uses the ExtensionFacade class that also provides query methods--log-events-verbose-text <file> CLI optionid() and after() for mock object expectationsFILE_EXTERNAL breaks __DIR__TestSuiteLoader is brittle and causes "Class FooTest not found" even for valid tests in valid filenamesLearn how to install or update PHPUnit 13.1 in the documentation.
The RegularExpression and StringMatchesFormatDescription did not handle preg_match() errors such as Compilation failed: regular expression is too larg
RegularExpression and StringMatchesFormatDescription did not handle preg_match() errors such as Compilation failed: regular expression is too largeLearn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
atLeast() with an argument that is not positivewith*() without expects()SourceMapper may be deleted prematurely when multiple PHPUnit processes run in parallelwith() is used without expects()Learn how to install or update PHPUnit 13.0 in the documentation.
Learn how to install or update PHPUnit 13.0 in the documentation.
method() returns InvocationMocker instead of InvocationStubber for test stubsLearn how to install or update PHPUnit 13.0 in the documentation.
--test-files-file CLI option to configure a file that contains the paths to the test files to be loaded (one file per line); use this when using CLI a
TestCase::invokeTestMethod() method for customizing test method invocationwithParameterSetsInOrder() and withParameterSetsInAnyOrder() for expecting calls to the same method of a mock object but with different argumentsassertArraysAreIdentical(), assertArraysAreIdenticalIgnoringOrder(), assertArraysHaveIdenticalValues(), assertArraysHaveIdenticalValuesIgnoringOrder(), assertArraysAreEqual(), assertArraysAreEqualIgnoringOrder(), assertArraysHaveEqualValues(), and assertArraysHaveEqualValuesIgnoringOrder() assertions--test-files-file <file> CLI option to configure a file that contains the paths to the test files to be loaded (one file per line); use this when using CLI arguments is not an option due to argument length limitationsany() matcher (hard deprecation)Assert::isType()assertContainsOnly() and assertNotContainsOnly()containsOnly()testClassName() method on event value objects for hook methods called for test methodsConfiguration::includeTestSuite() and Configuration::excludeTestSuite()--dont-report-useless-tests CLI option#[CoversNothing] on a test method#[RunClassInSeparateProcess] attributeLearn how to install or update PHPUnit 13.0 in the documentation.
The baseline generated using --generate-baseline contains an issue once for each time it was triggered, for instance once for each data set of a test
--generate-baseline contains an issue once for each time it was triggered, for instance once for each data set of a test that uses a data provider, instead of oncebuild/baseline.xml and the file in src--log-junit php://stdout is used, or php://stdout is configured for the JUnit XML logfile in the XML configuration file, and the test runner prints its regular output, the test runner ends with An error occurred inside PHPUnit after the JUnit XML was printed: the test results are not printed, code coverage reports and the baseline are not written, and the shell exit code is 255--log-junit php://stdout is used together with --stderr, the JUnit XML is printed to the standard error streamLearn how to install or update PHPUnit 12.5 in the documentation.
When an order is configured on the command line, for instance using --order-by random , defects configured using the executionOrder attribute in the X
--order-by random, defects configured using the executionOrder attribute in the XML configuration file is still applied, and vice versa--fail-on-skipped does not make the test runner exit with a shell exit code that indicates failure when a test class is skipped, for instance because its before-first-test method calls markTestSkipped(), although its tests are counted as skipped--stop-on-skipped does not stop the test run when a test class is skipped, for instance because its before-first-test method calls markTestSkipped()PHPUnit\ or SebastianBergmann\ namespace that do not belong to PHPUnit or one of its dependencies are preloaded on startup, which leads to a fatal error when such a code unit depends on code that is not availablenikic/php-parser and parts of the code from phar-io/manifest are not treated like code from PHPUnit's other dependencies, for instance stack frames from it are not filtered from stack tracesLearn how to install or update PHPUnit 12.5 in the documentation.
Issues whose message refers to an anonymous class could not be ignored using a baseline on PHP 8.6 (as of PHP 8.6, such messages contain the full name
method() is called for a method of a test double that cannot be configured, for instance because it does not exist, every subsequent invocation of a method of that test double fails with Method name is not configuredsetUp(), marks the test as incomplete, the hook method is reported as failedtearDown(), marks a successful test as incomplete or skips it, the test is reported as failedsetUpBeforeClass(), calls markTestIncomplete(), each test of the test class is reported as failed instead of the test class being skipped as it is when markTestSkipped() is calledtearDownAfterClass(), calls markTestIncomplete() or markTestSkipped() after the tests of the test class have been run, this is reported as a failure, also for each test of the test class that is run in process isolationassert(), in a hook method is reported as an error of that method instead of as a failure, and it is counted as an error instead of as a failure when that method is a before-first-test method or an after-last-test methodtearDown(), of a test that already failed, errored, or was marked as incomplete, a failure is reported in addition to the outcome of the test, so the test is counted more than once and onNotSuccessfulTest() is called with the failure from the "after test" method instead of the test's owntearDown(), is reported in addition to the test's failure, so the test is counted more than oncerequireCoverageMetadata="true" is configured, when it does not define a code coverage target, unlike a test that fails because an assertion failedsetUpBeforeClass()--debug and in the logfiles written by --log-events-text and --log-events-verbose-textgroups attribute of <directory> or <file> in the XML configuration file are not assigned to PHPT tests, so --group and --exclude-group do not select them and --list-groups and --list-tests-xml report them as being in the default group or not at allphpunit-library-X.Y.Z.phar) is no longer built, it could not be loaded since PHPUnit 9.5.8Learn how to install or update PHPUnit 12.5 in the documentation.
The static analysis cache directory that is automatically created in the operating system's path used for temporary files when no cache directory is c
Learn how to install or update PHPUnit 12.5 in the documentation.
The TeamCity logger writes testSuiteFinished twice for a test class when one of its before-first-test methods errors or fails
testSuiteFinished twice for a test class when one of its before-first-test methods errors or failstearDown() of a test that erroredLearn how to install or update PHPUnit 12.5 in the documentation.
The dependencies of a test that are listed after a dependency on a test that does not return a value, or after a dependency on a larger test, were not
CodeCoverage or Facade#[Before] method, skips the test, the remaining hook methods of the same kind are still called, so the test is reported as errored instead of skipped when one of them errorsE for the test class instead of one for each of its tests, only one of its tests is counted as run, and the test that is run next is shown as an errorsetUp(), and no end for the test that is run after itsetUp() raises an exception or the global state cannot be backed uptearDown() fails after the test errored]]>, bytes that are not valid UTF-8, or characters that are not allowed in XML, for instance the escape character of an ANSI escape sequenceLearn how to install or update PHPUnit 12.5 in the documentation.
The status of a test whose mock object raises an exception in its destructor is success although the test is reported as errored, so tearDown() sees t
-d extension or -d zend_extension are not loaded in child processestearDown() sees the wrong status and code coverage records the test as successfulwith() were matched by position instead of by name, so an expectation such as ->with(b: 7) compared the expected value with the first parameter of the method and the parameter named $b was not checkedLearn how to install or update PHPUnit 12.5 in the documentation.
The Software Bill of Materials (SBOM) embedded in the PHAR now uses CycloneDX 1.7 and provides the NTIA minimum elements as well as the data fields th
setUpBeforeClass() and tearDownAfterClass() were run twice for a test class that is the only test class in a test suite of the XML configuration file that has the name of that test class--ARGS-- section of a PHPT test that start with - were interpreted by PHP instead of being passed to the test when the test also has a --STDIN-- sectionLearn how to install or update PHPUnit 12.5 in the documentation.
The class name argument of #[RequiresMethod] is declared as class-string , so static analysis reports an error when it refers to a class that does not
#[RequiresMethod] is declared as class-string, so static analysis reports an error when it refers to a class that does not exist#[RequiresMethod] attribute that refers to a class which cannot be loaded, for instance because its parent class does not exist, aborts the test run instead of skipping the testLearn how to install or update PHPUnit 12.5 in the documentation.
Control characters and ANSI escape sequences in user-supplied strings such as test names, data set names, and messages are now made visible as \u{NNNN
\u{NNNN} escape sequences instead of being passed through to the terminalLearn how to install or update PHPUnit 12.5 in the documentation.
Paths of included files are now escaped when generating the code that is executed in a separate process, so that a path containing special characters
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation .
SourceMap is built in child process even though identifyIssueTrigger is disabledLearn how to install or update PHPUnit 12.5 in the documentation.
Regression that stopped test methods from being sorted by source code location
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation .
assertArrayHasKey() does not accept ArrayAccess implementations with a specific value type when test code is analysed with PHPStan at level 9Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
One column per quarter.