All notable changes of the PHPUnit 11.0 release series are documented in this file using the Keep a CHANGELOG principles.
11.0.4 - 2024-02-29
- #5704: No warning when CLI options are used multiple times
- #5707:
--fail-on-empty-test-suite
CLI option is not documented in--help
output - #5716: Better respect PHP native array key handling for
assertArrayIs*ToArrayOnlyConsideringListOfKeys()
11.0.3 - 2024-02-10
- Tests that do not unregister their error handlers or exception handlers are no longer considered risky when they are run in an isolated process
- When a test (or the code called from it) does not unregister its own error handlers and its own exception handlers then only the latter was reported
- Resource usage information is printed when the
--debug
CLI option is used
11.0.2 - 2024-04-04
- #5692:
--log-events-text
and--log-events-verbose-text
require the destination file to exit
11.0.1 - 2024-02-02
- #5690: Backward Compatibility break in
PHPUnit\Framework\Constraint\Constraint
11.0.0 - 2024-02-02
- #4964: Enable named data sets with the
#[TestWith*]
attributes - #5225: Allow providing named arguments from a data provider
- #5600: Assertions for comparing arrays while ignoring a specified list of keys
- #5605:
expectUserDeprecationMessage()
andexpectUserDeprecationMessageMatches()
for expectingE_USER_DEPRECATED
issues - #5620: Implement
group
attribute on<directory>
and<file>
elements (children of<testsuite>
) to add all tests found in a directory or file to a specified group - #5629:
--exclude-filter
CLI option for excluding tests from execution - #5642:
--list-test-files
CLI option to print the list of test files
- #5213: Make
TestCase
methodsprotected
that should have beenprotected
all along - #5254: Make
TestCase
methodsfinal
that should have beenfinal
all along - #5619: Check and restore error/exception global handlers
- The format of the XML document generated using the
--list-tests-xml
CLI option has been changed small
,medium
, andlarge
can no longer be used as group names with the#[Group]
attribute- A test can no longer be part of multiple test suites that are configured in the XML configuration file
--check-version
now exits with a shell exit code that indicates failure when the version is not the latest version
- #4505: Support for metadata in doc-comments
- #5214:
TestCase::iniSet()
(this method was already soft-deprecated in PHPUnit 10) - #5216:
TestCase::setLocale()
(this method was already soft-deprecated in PHPUnit 10) - #5240:
TestCase::createTestProxy()
(this method was already soft-deprecated in PHPUnit 10) - #5241:
TestCase::getMockForAbstractClass()
(this method was already soft-deprecated in PHPUnit 10) - #5242:
TestCase::getMockFromWsdl()
(this method was already soft-deprecated in PHPUnit 10) - #5243:
TestCase::getMockForTrait()
(this method was already soft-deprecated in PHPUnit 10) - #5244:
TestCase::getObjectForTrait()
(this method was already soft-deprecated in PHPUnit 10) - #5305:
MockBuilder::getMockForAbstractClass()
(this method was already soft-deprecated in PHPUnit 10) - #5306:
MockBuilder::getMockForTrait()
(this method was already soft-deprecated in PHPUnit 10) - #5307:
MockBuilder::enableProxyingToOriginalMethods()
,MockBuilder::disableProxyingToOriginalMethods()
, andMockBuilder::setProxyTarget()
(these methods were already soft-deprecated in PHPUnit 10) - #5308:
MockBuilder::allowMockingUnknownTypes()
andMockBuilder::disallowMockingUnknownTypes()
(these methods were already soft-deprecated in PHPUnit 10) - #5309:
MockBuilder::enableAutoload()
andMockBuilder::disableAutoload()
(these methods were already soft-deprecated in PHPUnit 10) - #5315:
MockBuilder::enableArgumentCloning()
andMockBuilder::disableArgumentCloning()
(these methods were already soft-deprecated in PHPUnit 10) - #5320:
MockBuilder::addMethods()
(this method was already soft-deprecated in PHPUnit 10) - #5415: Support for doubling interfaces (or classes) that have a method named
method
- #5423:
TestCase::returnValue()
,TestCase::onConsecutiveCalls()
,TestCase::returnValueMap()
,TestCase::returnArgument()
,TestCase::returnSelf()
, andTestCase::returnCallback()
(these methods were already soft-deprecated in PHPUnit 10) - #5472:
assertStringNotMatchesFormat()
andassertStringNotMatchesFormatFile()
(these methods were already soft-deprecated in PHPUnit 10) - #5535: Configuring expectations using
expects()
on test stubs
- #4600: Support for old cache configuration
- #4604: Support for
backupStaticAttributes
attribute in XML configuration file - #4779: Support for
forceCoversAnnotation
andbeStrictAboutCoversAnnotation
attributes in XML configuration file - #5100: Support for non-static data provider methods, non-public data provider methods, and data provider methods that declare parameters
- #5101: Support for PHP 8.1
- #5272: Optional parameters of
PHPUnit\Framework\Constraint\IsEqual::__construct()
- #5329: Support for configuring include/exclude list for code coverage using the
<coverage>
element - #5482:
dataSet
attribute fortestCaseMethod
elements in the XML document generated by--list-tests-xml
- #5514:
IgnoreClassForCodeCoverage
,IgnoreMethodForCodeCoverage
, andIgnoreFunctionForCodeCoverage
attributes - #5604:
Test\AssertionFailed
andTest\AssertionSucceeded
events registerMockObjectsFromTestArgumentsRecursively
attribute on the<phpunit>
element of the XML configuration fileCodeCoverageIgnore
attributePHPUnit\TextUI\Configuration\Configuration::coverageExcludeDirectories()
(usePHPUnit\TextUI\Configuration\Configuration::source()->excludeDirectories()
instead)PHPUnit\TextUI\Configuration\Configuration::coverageExcludeFiles()
(usePHPUnit\TextUI\Configuration\Configuration::source()->excludeFiles()
instead)PHPUnit\TextUI\Configuration\Configuration::coverageIncludeDirectories()
(usePHPUnit\TextUI\Configuration\Configuration::source()->includeDirectories()
instead)PHPUnit\TextUI\Configuration\Configuration::coverageIncludeFiles()
(usePHPUnit\TextUI\Configuration\Configuration::source()->includeFiles()
instead)PHPUnit\TextUI\Configuration\Configuration::loadPharExtensions()
(usePHPUnit\TextUI\Configuration\Configuration::noExtensions()
instead)PHPUnit\TextUI\Configuration\Configuration::hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()
(usePHPUnit\TextUI\Configuration\Configuration::source()->notEmpty()
instead)PHPUnit\TextUI\Configuration\Configuration::restrictDeprecations()
(usePHPUnit\TextUI\Configuration\Configuration::source()->restrictDeprecations()
instead)PHPUnit\TextUI\Configuration\Configuration::restrictNotices()
(usePHPUnit\TextUI\Configuration\Configuration::source()->restrictNotices()
instead)PHPUnit\TextUI\Configuration\Configuration::restrictWarnings()
(usePHPUnit\TextUI\Configuration\Configuration::source()->restrictWarnings()
instead)PHPUnit\TextUI\Configuration\Configuration::cliArgument()
(usePHPUnit\TextUI\Configuration\Configuration::cliArguments()[0]
instead)PHPUnit\TextUI\Configuration\Configuration::hasCliArgument()
(usePHPUnit\TextUI\Configuration\Configuration::hasCliArguments()
instead)PHPUnit\TextUI\Configuration\Configuration::registerMockObjectsFromTestArgumentsRecursively()
PHPUnit\Framework\Constraint\Constraint::exporter()