All notable changes of the PHPUnit 10.0 release series are documented in this file using the Keep a CHANGELOG principles.
10.0.0 - 2022-MM-DD
- #4502: Support PHP 8 attributes for adding metadata to test classes and test methods as well as tested code units
- #4641:
assertStringEqualsStringIgnoringLineEndings()andassertStringContainsStringIgnoringLineEndings() - #4650: Support dist file name
phpunit.dist.xml - #4657:
--exclude-testsuiteoption - #4818:
assertArrayIsList() - #4892: Make colors used in HTML code coverage report configurable
- #4893: Make path to custom.css for HTML code coverage report configurable
@excludeGlobalVariableFromBackup variableannotation for excluding a global variable from the backup/restore of global and super-global variables#[ExcludeGlobalVariableFromBackup('variable')]attribute for excluding a global variable from the backup/restore of global and super-global variables@excludeStaticPropertyFromBackup className propertyNameannotation for excluding a static property from the backup/restore of static properties in user-defined classes#[ExcludeStaticPropertyFromBackup('className', 'propertyName')]attribute for excluding a static property from the backup/restore of static properties in user-defined classes--trace-text <file>option that controls streaming of event information in text format to a file--no-outputoption to disable the output
- #3871: Declare return types for
InvocationStubbermethods - #3954: Disable global state preservation for process isolation by default
- #4599: Unify cache configuration
- #4603: Use "property" instead of "attribute" for configuring the backup of static fields
- #4656: Prevent doubling of
__destruct() - PHPUnit no longer invokes a static method named
suiteon a class that is declared in a file that is passed as an argument to the CLI test runner - PHPUnit no longer promotes variables that are global in the bootstrap script's scope to global variables in the test runner's scope (use
$GLOBALS['variable'] = 'value'instead of$variable = 'value'in your bootstrap script) PHPUnit\Framework\TestCase::$backupGlobalscan no longer be used to enable or disable the backup/restore of global and super-global variables for a test case classPHPUnit\Framework\TestCase::$backupStaticAttributescan no longer be used to enable or disable the backup/restore of static properties in user-defined classes for a test case class@authoris no longer an alias for@group- The
statusattribute of<test>elements in the TestDox XML logfile now contains a textual representation instead of a number ("success"instead of"0", for instance) - The
sizeattribute of<test>elements in the TestDox XML logfile now contains a textual representation instead of a number ("unknown"instead of"-1", for instance) - The JUnit XML logfile now has both
nameandfileattributes on<testcase>elements for PHPT tests - The
forceCoversAnnotationattribute of the<phpunit>element of PHPUnit's XML configuration file has been renamed torequireCoverageMetadata - The
beStrictAboutCoversAnnotationattribute of the<phpunit>element of PHPUnit's XML configuration file has been renamed tobeStrictAboutCoverageMetadata
- #3389: Removed
PHPUnit\Framework\TestListenerandPHPUnit\Framework\TestListenerDefaultImplementation - #3631: Remove support for
"ClassName<*>"as values for@coversand@usesannotations - #3769: Remove
MockBuilder::setMethods()andMockBuilder::setMethodsExcept() - #3777: Remove
PHPUnit\Framework\Error\*classes - #4063: Remove
assertNotIsReadable() - #4066: Remove
assertNotIsWritable() - #4069: Remove
assertDirectoryNotExists() - #4072: Remove
assertDirectoryNotIsReadable() - #4075: Remove
assertDirectoryNotIsWritable() - #4078: Remove
assertFileNotExists() - #4081: Remove
assertFileNotIsReadable() - #4087: Remove
assertRegExp() - #4090: Remove
assertNotRegExp() - #4092: Remove
assertEqualXMLStructure() - #4142: Remove Prophecy integration
- #4227: Remove
--dump-xdebug-filterand--prepend - #4272: Remove
PHPUnit\Util\Blacklist - #4273: Remove
PHPUnit\Framework\TestCase::$backupGlobalsBlacklist - #4274: Remove
PHPUnit\Framework\TestCase::$backupStaticAttributesBlacklist - #4278: Remove
--whitelistoption - #4279: Remove support for old code coverage configuration
- #4286: Remove support for old logging configuration
- #4298: Remove
at()matcher - #4395: Remove
Command::createRunner() - #4397: Remove confusing parameter options for XML assertions
- #4531: Remove
--loaderoption as well astestSuiteLoaderClassandtestSuiteLoaderFileXML configuration settings - #4536: Remove
assertFileNotIsWritable() - #4596: Remove Test Hooks
- #4564: Deprecate
withConsecutive() - #4567: Deprecate support for generators in
assertCount()andCountconstraint - #4601: Deprecate assertions that operate on class/object properties
- Removed the
PHPUnit\Runner\TestSuiteLoaderinterface - Removed the
<listeners>XML configuration element and its children - Removed the
groupsattribute on the<test>element in the TestDox XML report - Removed the
beStrictAboutResourceUsageDuringSmallTestsattribute on the<phpunit>XML configuration element and the--disallow-resource-usageoption as well as the feature they used to control - Removed the
beStrictAboutTodoAnnotatedTestsattribute on the<phpunit>XML configuration element and the--disallow-todo-testsoption as well as the feature they used to control - Removed the
processUncoveredFilesattribute on the<coverage>XML configuration element - Removed the
PHPUnit\Framework\TestCase::getMockClass()method - Removed the
PHPUnit\Framework\TestCase::$backupGlobalsExcludeListproperty, use the@excludeGlobalVariableFromBackup variableannotation or the#[ExcludeGlobalVariableFromBackup('variable')]attribute instead for excluding a global variable from the backup/restore of global and super-global variables - Removed the
PHPUnit\Framework\TestCase::$backupStaticAttributesExcludeListproperty, use the@excludeStaticPropertyFromBackup className propertyNameannotation or the#[ExcludeStaticPropertyFromBackup('className', 'propertyName')]attribute instead for excluding a static property from the backup/restore of static properties in user-defined classes - Removed the
PHPUnit\Framework\TestCase::$preserveGlobalStateproperty, use the@preserveGlobalState enabledannotation or the#[PreserveGlobalState(true)]attribute instead for enabling the preservation of global state when running tests in isolation - Removed the
--debugoption - Removed the
--extensionsoption - Removed the
--printeroption - Removed the
printerClassandprinterFileattributes on the<phpunit>XML configuration element - The CLI test runner can no longer be extended through inheritance, the
PHPUnit\TextUI\Commandclass has been removed - PHP 7.3, PHP 7.4, and PHP 8.0 are no longer supported