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 2 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.
Class, method, and data-set names in TestDox HTML report are not escaped
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 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 12.5 in the documentation.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Learn how to install or update PHPUnit 12.5 in the documentation.
assertXmlStringEqualsXmlString() regressed into treating comments as significantLearn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
-d settings forwarded to child processes (breaks PCOV coverage)Learn how to install or update PHPUnit 12.5 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 12.5 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 12.5 in the documentation.
MockBuilder::setMockClassName() and TestStubBuilder::setStubClassName() now reject values that are not valid unqualified PHP class identifiers, throwi
TestCase::invokeTestMethod() method for customizing test method invocation from PHPUnit 13testStarted and testFinishedMockBuilder::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 12.5 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 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
; and " are not preserved when forwarding settings to child processesLearn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 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 skipsLearn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 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 12.5 in the documentation.
Regression in XML configuration migration introduced in PHPUnit 12.5.8
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 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 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 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 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
%r...%r in EXPECTF sectionFILE_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 12.5 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 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.
Learn 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.
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
with*() on test stubsSourceMapper may be deleted prematurely when multiple PHPUnit processes run in parallelwith() is used without expects()Learn 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.
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
To prevent Poisoned Pipeline Execution (PPE) attacks using prepared .coverage files in pull requests, a PHPT test will no longer be run if the tempora
.coverage files in pull requests, a PHPT test will no longer be run if the temporary file for writing code coverage information already exists before the test runsLearn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
Count::getCountOf() for unusal implementations of Iterator or IteratorAggregateLearn how to install or update PHPUnit 12.5 in the documentation.
Reverted a change that caused a build failure for the PHP project's nightly community job
Learn how to install or update PHPUnit 12.5 in the documentation.
Learn how to install or update PHPUnit 12.5 in the documentation.
any() matcher (soft deprecation)Learn how to install or update PHPUnit 12.5 in the documentation.
The #[AllowMockObjectsWithoutExpectations] attribute can now be used on the method level
#[AllowMockObjectsWithoutExpectations] attribute can now be used on the method levelTimer::start() has to be called before Timer::stop()Learn how to install or update PHPUnit 12.5 in the documentation.
The message emitted when a test method creates a mock object but does not configure any expectations for it has been improved
Learn how to install or update PHPUnit 12.5 in the documentation.
Attribute #[AllowMockObjectsWithoutExpectations] for excluding tests from the check that emits the notice for test methods that create a mock object b
#[AllowMockObjectsWithoutExpectations] for excluding tests from the check that emits the notice for test methods that create a mock object but do not configure an expectation for itLearn how to install or update PHPUnit 12.5 in the documentation.
TestCase::getStubBuilder() (analogous to TestCase::getMockBuilder()) for creating (partial) test stubs using a fluent API
TestCase::getStubBuilder() (analogous to TestCase::getMockBuilder()) for creating (partial) test stubs using a fluent APILearn how to install or update PHPUnit 12.5 in the documentation.
A PHPUnit notice is now emitted for test methods that create a mock object but do not configure an expectation for it
--all CLI option to ignore test selection configured in XML configuration file<source> element in XML code coverage report optionalThrowable in expectExceptionObject()Learn how to install or update PHPUnit 12.5 in the documentation.
Updated list of deprecated PHP configuration settings for PHP 8.4, PHP 8.5, and PHP 8.6
Learn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.4 in the documentation.
STDOUT when rewind() failsLearn how to install or update PHPUnit 12.4 in the documentation.
Skipped tests alone no longer lead to a yellow background for the test result summary
Learn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.4 in the documentation.
--filter format used by PhpStorm stopped workingDataProviderMethodCalled event value objectLearn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.4 in the documentation.
#[IgnoreDeprecations] attribute#[RunClassInSeparateProcess] attributeLearn how to install or update PHPUnit 12.4 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
failOnPhpunitWarning="false" has no effectLearn how to install or update PHPUnit 12.3 in the documentation.
No changes; phpunit.phar rebuilt with updated dependencies
phpunit.phar rebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
No changes; phpunit.phar rebuilt with updated dependencies
phpunit.phar rebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
No changes; phpunit.phar rebuilt with updated dependencies
phpunit.phar rebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
__sleep() and __wakeup() from test double code generation on PHP >= 8.5Learn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
E_DEPRECATED issues when building the test suiteLearn how to install or update PHPUnit 12.3 in the documentation.
Do not use __sleep() method (which will be deprecated in PHP 8.5)
__sleep() method (which will be deprecated in PHP 8.5)Learn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
#[IgnorePhpunitDeprecations] is now considered for test runner deprecations (where applicable)Learn how to install or update PHPUnit 12.3 in the documentation.
Nothing published for this version
Learn how to install or update PHPUnit 12.3 in the documentation.
error_reporting=E_ALL for --check-php-configurationexpectUserDeprecationMessage*() fails when test is run in separate processLearn how to install or update PHPUnit 12.3 in the documentation.
The version number for the test result cache file has been incremented to reflect that its structure for PHPUnit 12.3 is not compatible with its struc
--check-php-configurationini_set('error_log') sets filepath outside open_basedirLearn how to install or update PHPUnit 12.3 in the documentation.
Learn how to install or update PHPUnit 12.3 in the documentation.
#[IgnorePhpunitDeprecations] is now considered for test runner deprecations" from PHPUnit 12.3.1)Learn how to install or update PHPUnit 12.3 in the documentation.
Do not use SplObjectStorage methods that will be deprecated in PHP 8.5
testSplObjectStorage methods that will be deprecated in PHP 8.5Learn how to install or update PHPUnit 12.3 in the documentation.
Errors due to invalid data provided using #[TestWith] or #[TestWithJson] attributes are now properly reported
--check-php-configuration CLI option for checking whether PHP is configured for testing#[IgnorePhpunitDeprecations] is now considered for test runner deprecations (where applicable)#[TestWith] or #[TestWithJson] attributes are now properly reportedDataProviderMethodFinished event is now also emitted when the provided data set has an invalid keyLearn how to install or update PHPUnit 12.3 in the documentation.
TestRunner\ChildProcessErrored event
#[IgnorePHPUnitWarnings] attribute for ignoring PHPUnit warnings#[TestDoxFormatter] and #[TestDoxFormatterExternal] attributes for configuring a custom TestDox formatter for tests that use data from data providersTestRunner\ChildProcessErrored eventConfiguration::includeTestSuites() and Configuration::excludeTestSuites()@<data-set-name> format (compatible with --filter CLI option) in defect messages#[DataProvider*] attributes are mixed with #[TestWith*] attributesConfiguration::includeTestSuite(), use Configuration::includeTestSuites() insteadConfiguration::excludeTestSuite(), use Configuration::excludeTestSuites() instead#[CoversNothing] on a test methodHow to install or update PHPUnit
How to install or update PHPUnit
How to install or update PHPUnit
defects,randomconfiguration is supported by implementation, but it is not allowed by the XML configuration file schematest prefixHow to install or update PHPUnit
How to install or update PHPUnit
Including information about the Git repository (such as the commit hash and branch name) in the Open Test Reporting XML format is now an opt-in featur
--include-git-information CLI option or the includeGitInformation attribute in the XML configuration file--do-not-report-useless-tests CLI option as a replacement for --dont-report-useless-tests
failOnPhpunitWarning attribute on the <phpunit> element of the XML configuration file and --fail-on-phpunit-warning CLI option for controlling whether PHPUnit should fail on PHPUnit warnings (default: true)--do-not-fail-on-deprecation, --do-not-fail-on-phpunit-warning, --do-not-fail-on-phpunit-deprecation, --do-not-fail-on-empty-test-suite, --do-not-fail-on-incomplete, --do-not-fail-on-notice, --do-not-fail-on-risky, --do-not-fail-on-skipped, and --do-not-fail-on-warning CLI options--do-not-report-useless-tests CLI option as a replacement for --dont-report-useless-tests--dont-report-useless-tests CLI option (use --do-not-report-useless-tests instead)ExpectationFailedExceptionOne column per quarter.