All notable changes of the PHPUnit 10.0 release series are documented in this file using the Keep a CHANGELOG principles.
10.0.14 - 2023-03-01
- The
PHPUnit\Event\Test\AssertionSucceededandPHPUnit\Event\Test\AssertionFailedevents are no longer emitted when they have no subscribers - The
PHPUnit\Event\Test\AssertionSucceeded::value()method is no longer deprecated and returns the exported value again
10.0.13 - 2023-02-27
- #5186: SBOM does not validate
- #5258: JUnit logger crashes when test is skipped by missing PHP extension when running in separate process
10.0.12 - 2023-02-25
- Values of other types than
arraymay now be passed toassertIsList()
- #5234: Constants defined in configuration file are not defined in bootstrap file when test is run in separate process
- #5251: JUnit XML logger does not properly handle errors on unprepared tests
10.0.11 - 2023-02-20
- #5192: Running an empty test shows help screen
- #5224: PHPUnit looks "at the clock" and trusts
$_SERVER['REQUEST_TIME_FLOAT']
10.0.10 - 2023-02-20
- #5218: Code Coverage does not work for tests run in separate process(es)
- #5219: Exceptions thrown in event subscribers affect how tests are run and/or how their outcome is evaluated
10.0.9 - 2023-02-19
- Corrected the fix for #5210
10.0.8 - 2023-02-18
- #5210: Exceptions raised in
TestCase::tearDown()are not handled correctly
10.0.7 - 2023-02-08
- The
PHPUnit\Event\Test\AssertionSucceeded::value()method is now deprecated and always returns''(reverted in PHPUnit 10.0.14)
- #5183: Values used in assertions are exported for
Test\AssertionSucceededevents
10.0.6 - 2023-02-08
- #5178: Test depending on a test with data provider is always skipped
10.0.5 - 2023-02-07
- #5172: Test Runner does not display test runner warnings when TestDox result printer is used
- #5176: Silenced
E_DEPRECATEDerrors are reported
10.0.4 - 2023-02-05
- #5169: Parameter type for constructor of
GreaterThanandLessThanconstraints does not match parameter type forAssert::greaterThan()andAssert::lessThan() - #5171:
@backupStaticPropertiesand@backupStaticAttributestrigger an error
10.0.3 - 2023-02-04
PHPUnit\Event\TestSuite\SkippedandPHPUnit\Event\TestSuite\SkippedSubscriber(required for the fixing #5165)
- #5165:
markTestSkipped()not handled correctly when called in "before first test" method - #5166: Error when generating TestDox output for risky test
10.0.2 - 2023-02-04
- The
PHPUnit\TextUI\Configuration\Configuration::loadPharExtensions()method has been deprecated in favour ofPHPUnit\TextUI\Configuration\Configuration::noExtensions()
- #5073:
--no-extensionsCLI option only prevents extension PHARs from being loaded assertNotCount(),assertEmpty(),assertNotEmpty(),assertSameSize(), andassertNotSameSize()now rejectGeneratorarguments just asassertCount()does
10.0.1 - 2023-02-03
- #5157: Test Runner tries to run hook methods for
TestSuiteobjects that do not collectTestCaseobjects
10.0.0 - 2023-02-03
- #4676: Event System for extending PHPUnit's test runner
- #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:
assertIsList() - #4892: Make colors used in HTML code coverage report configurable
- #4893: Make path to custom.css for HTML code coverage report configurable
- #5097: Support for
enumvalues in TestDox placeholder replacements TestCase::createStubForIntersectionOfInterfaces()andTestCase::createMockForIntersectionOfInterfaces()#[ExcludeGlobalVariableFromBackup('variable')]attribute for excluding a global variable from the backup/restore of global and super-global variables#[ExcludeStaticPropertyFromBackup('className', 'propertyName')]attribute for excluding a static property from the backup/restore of static properties in user-defined classes--log-events-text <file>option that controls streaming of event information (without event telemetry) in text format to a file--log-events-verbose-text <file>option that controls streaming of event information (with event telemetry) in text format to a file--no-progressoption to disable test execution progress output--no-resultsoption to disable test result output--no-outputoption to disable all output--display-incompleteoption anddisplayDetailsOnIncompleteTestsXML configuration attribute to control whether details on incomplete tests should be displayed--display-skippedoption anddisplayDetailsOnSkippedTestsXML configuration attribute to control whether details on skipped tests should be displayed--display-deprecationsoption anddisplayDetailsOnTestsThatTriggerDeprecationsXML configuration attribute to control whether details on tests that triggerE_DEPRECATEDorE_USER_DEPRECATEDshould be displayed--display-errorsoption anddisplayDetailsOnTestsThatTriggerErrorsXML configuration attribute to control whether details on tests that triggerE_ERRORorE_USER_ERRORshould be displayed--display-noticesoption anddisplayDetailsOnTestsThatTriggerNoticesXML configuration attribute to control whether details on tests that triggerE_STRING,E_NOTICE, orE_USER_NOTICEshould be displayed--display-warningsoption anddisplayDetailsOnTestsThatTriggerWarningsXML configuration attribute to control whether details on tests that triggerE_WARNINGorE_USER_WARNINGshould be displayed
- #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() - Expectations configured on test stubs created using
PHPUnit\Framework\TestCase::createStub()are no longer evaluated, you need to create a mock object usingPHPUnit\Framework\TestCase::createMock()instead - Using a non-static method as a data provider is now deprecated
- Using a non-public method as a data provider is now deprecated
- Declaring a data provider method to require an argument is now deprecated
- A test method now continues execution after test(ed) code triggered
E_(USER_)DEPRECATED,E_(USER_)NOTICE,E_STRICT, orE_(USER_)WARNING - 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 JUnit XML logfile now has both
nameandfileattributes on<testcase>elements for PHPT tests - The JUnit XML logfile no longer has
<system-out>elements that contain the output printed tostdoutby a test - The JUnit XML logfile now only reports test outcome (errored, failed, incomplete, skipped, or passed) and no longer test issues (considered risky, for instance)
- 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 - The public methods of
PHPUnit\Framework\AssertandPHPUnit\Framework\TestCaseare nowfinal - The
PHPUnit\Framework\TestCase::onNotSuccessfulTest()method can no longer manipulate the outcome of a test - The
--testdoxCLI option no longer replaces the default progress output, but only the default result output - The CLI test runner now only stops after a test errored when
--stop-on-erroror--stop-on-defectis used - The CLI test runner now only stops after a test failed when
--stop-on-failureor--stop-on-defectis used - The CLI test runner now only stops after a test triggered a warning when
--stop-on-warningor--stop-on-defectis used - The CLI test runner now only stops after a test was marked as risky when
--stop-on-riskyor--stop-on-defectis used - The CLI test runner now only stops after a test was skipped when
--stop-on-skippedis used - The CLI test runner now only stops after a test was marked as incomplete when
--stop-on-incompleteis used
- #3389: Remove
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 - #4397: Remove confusing parameter options for XML assertions
- #4531: Remove
--loaderoption as well astestSuiteLoaderClassandtestSuiteLoaderFileXML configuration settings - #4536: Remove
assertFileNotIsWritable() - #4596: Remove Test Hooks
- #4564: Remove
withConsecutive() - #4567: Remove support for generators in
assertCount()andCountconstraint - #4601: Remove assertions that operate on class/object properties
- Removed the
expectDeprecation(),expectDeprecationMessage(), andexpectDeprecationMessageMatches()methods - Removed the
expectError(),expectErrorMessage(), andexpectErrorMessageMatches()methods - Removed the
expectNotice(),expectNoticeMessage(), andexpectNoticeMessageMatches()methods - Removed the
expectWarning(),expectWarningMessage(), andexpectWarningMessageMatches()methods - Removed the
PHPUnit\Runner\TestSuiteLoaderinterface - Removed the
<listeners>XML configuration element and its children - 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
convertDeprecationsToExceptionsattribute on the<phpunit>XML configuration element as well as the feature it used to control - Removed the
convertErrorsToExceptionsattribute on the<phpunit>XML configuration element as well as the feature it used to control - Removed the
convertNoticesToExceptionsattribute on the<phpunit>XML configuration element as well as the feature it used to control - Removed the
convertWarningsToExceptionsattribute on the<phpunit>XML configuration element as well as the feature it used to control - Removed the
noInteractionattribute on the<phpunit>XML configuration element and--no-interactionoption as well as the feature they used to control - Removed the
processUncoveredFilesattribute on the<coverage>XML configuration element - Removed the
testdoxGroupsXML configuration element, the--testdox-groupoption, and the--testdox-exclude-groupoption as well as the feature they used to control - Removed the
PHPUnit\Framework\TestCase::getMockClass()method - Removed the
PHPUnit\Framework\TestCase::$backupGlobalsExcludeListproperty, use 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', '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
--repeatoption - Removed the
--debugoption - Removed the
--extensionsoption - Removed the
--printeroption - Removed the
printerClassandprinterFileattributes on the<phpunit>XML configuration element - Removed the
--testdox-xmloption and the<testdoxXml>XML configuration element as well as the feature they used to control - Removed the
--verboseoption - Removed the
verboseattribute on the<phpunit>XML configuration element - Removed the
<text>XML configuration element (child of<logging>) - 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
phpunit/php-code-coverageno longer supports PHPDBG and Xdebug 2