diff --git a/.github/ISSUE_TEMPLATE/1_BUG.md b/.github/ISSUE_TEMPLATE/1_BUG.md
new file mode 100644
index 00000000000..7b44a6f91e5
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1_BUG.md
@@ -0,0 +1,39 @@
+---
+name: 🐞 Bug Report for PHPUnit 9 and PHPUnit 10
+about: Something is broken in PHPUnit 9 and in PHPUnit 10?
+labels: type/bug, version/9, version/10
+---
+
+
+
+| Q | A
+| --------------------| ---------------
+| PHPUnit version | x.y.z
+| PHP version | x.y.z
+| Installation Method | Composer / PHAR
+
+#### Summary
+
+
+
+#### Current behavior
+
+
+
+#### How to reproduce
+
+
+
+#### Expected behavior
+
+
diff --git a/.github/ISSUE_TEMPLATE/2_BUG_PHPUNIT_10.md b/.github/ISSUE_TEMPLATE/2_BUG_PHPUNIT_10.md
new file mode 100644
index 00000000000..6976ad44234
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2_BUG_PHPUNIT_10.md
@@ -0,0 +1,39 @@
+---
+name: 🐞 Bug Report for PHPUnit 10
+about: Something is broken in PHPUnit 10, but it works in PHPUnit 9?
+labels: type/bug, version/10
+---
+
+
+
+| Q | A
+| --------------------| ---------------
+| PHPUnit version | x.y.z
+| PHP version | x.y.z
+| Installation Method | Composer / PHAR
+
+#### Summary
+
+
+
+#### Current behavior
+
+
+
+#### How to reproduce
+
+
+
+#### Expected behavior
+
+
diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/3_BUG_PHPUNIT_9.md
similarity index 91%
rename from .github/ISSUE_TEMPLATE/BUG.md
rename to .github/ISSUE_TEMPLATE/3_BUG_PHPUNIT_9.md
index b9db2c64ad1..2b0d58909a7 100644
--- a/.github/ISSUE_TEMPLATE/BUG.md
+++ b/.github/ISSUE_TEMPLATE/3_BUG_PHPUNIT_9.md
@@ -1,7 +1,7 @@
---
-name: 🐞 Bug Report
-about: Something is broken?
-labels: type/bug
+name: 🐞 Bug Report for PHPUnit 9
+about: Something is broken in PHPUnit 9, but it works in PHPUnit 10?
+labels: type/bug, version/9
---
+
+| Q | A
+| --------------------| ---------------
+| PHPUnit version | x.y.z
+| PHP version | x.y.z
+| Installation Method | Composer / PHAR
+
+#### Summary
+
+
+
+#### Current behavior
+
+
+
+#### How to reproduce
+
+
+
+#### Expected behavior
+
+
diff --git a/.github/ISSUE_TEMPLATE/5_COMPATIBILITY_PHPUNIT_9.md b/.github/ISSUE_TEMPLATE/5_COMPATIBILITY_PHPUNIT_9.md
new file mode 100644
index 00000000000..029316ecded
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/5_COMPATIBILITY_PHPUNIT_9.md
@@ -0,0 +1,39 @@
+---
+name: ⚠️ PHP Compatibility Issue in PHPUnit 9
+about: A change in a new version of PHP requires adaption in PHPUnit 9?
+labels: type/change-in-php-requires-adaptation, version/9
+---
+
+
+
+| Q | A
+| --------------------| ---------------
+| PHPUnit version | x.y.z
+| PHP version | x.y.z
+| Installation Method | Composer / PHAR
+
+#### Summary
+
+
+
+#### Current behavior
+
+
+
+#### How to reproduce
+
+
+
+#### Expected behavior
+
+
diff --git a/.github/ISSUE_TEMPLATE/6_COMPATIBILITY_PHPUNIT_8.md b/.github/ISSUE_TEMPLATE/6_COMPATIBILITY_PHPUNIT_8.md
new file mode 100644
index 00000000000..f3137317489
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/6_COMPATIBILITY_PHPUNIT_8.md
@@ -0,0 +1,39 @@
+---
+name: ⚠️ PHP Compatibility Issue in PHPUnit 8
+about: A change in a new version of PHP requires adaption in PHPUnit 8?
+labels: type/change-in-php-requires-adaptation, version/8
+---
+
+
+
+| Q | A
+| --------------------| ---------------
+| PHPUnit version | x.y.z
+| PHP version | x.y.z
+| Installation Method | Composer / PHAR
+
+#### Summary
+
+
+
+#### Current behavior
+
+
+
+#### How to reproduce
+
+
+
+#### Expected behavior
+
+
diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/7_FEATURE_REQUEST.md
similarity index 100%
rename from .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
rename to .github/ISSUE_TEMPLATE/7_FEATURE_REQUEST.md
diff --git a/.phive/phars.xml b/.phive/phars.xml
index 9e7784c0738..152b950a255 100644
--- a/.phive/phars.xml
+++ b/.phive/phars.xml
@@ -1,8 +1,8 @@
-
-
+
+
-
+
diff --git a/ChangeLog-10.0.md b/ChangeLog-10.0.md
index 9901f1b4cfe..601003f7867 100644
--- a/ChangeLog-10.0.md
+++ b/ChangeLog-10.0.md
@@ -2,6 +2,12 @@
All notable changes of the PHPUnit 10.0 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
+## [10.0.8] - 2023-02-18
+
+### Fixed
+
+* [#5210](https://github.com/sebastianbergmann/phpunit/issues/5210): Exceptions raised in `TestCase::tearDown()` are not handled correctly
+
## [10.0.7] - 2023-02-08
### Changed
@@ -111,6 +117,7 @@ All notable changes of the PHPUnit 10.0 release series are documented in this fi
* The `forceCoversAnnotation` attribute of the `` element of PHPUnit's XML configuration file has been renamed to `requireCoverageMetadata`
* The `beStrictAboutCoversAnnotation` attribute of the `` element of PHPUnit's XML configuration file has been renamed to `beStrictAboutCoverageMetadata`
* The public methods of `PHPUnit\Framework\Assert` and `PHPUnit\Framework\TestCase` are now `final`
+* The `PHPUnit\Framework\TestCase::onNotSuccessfulTest()` method can no longer manipulate the outcome of a test
* The `--testdox` CLI 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-error` or `--stop-on-defect` is used
* The CLI test runner now only stops after a test failed when `--stop-on-failure` or `--stop-on-defect` is used
@@ -183,6 +190,7 @@ All notable changes of the PHPUnit 10.0 release series are documented in this fi
* PHP 7.3, PHP 7.4, and PHP 8.0 are no longer supported
* `phpunit/php-code-coverage` [no longer supports PHPDBG and Xdebug 2](https://github.com/sebastianbergmann/php-code-coverage/blob/10.0.0/ChangeLog.md#1000---2023-02-03)
+[10.0.8]: https://github.com/sebastianbergmann/phpunit/compare/10.0.7...10.0.8
[10.0.7]: https://github.com/sebastianbergmann/phpunit/compare/10.0.6...10.0.7
[10.0.6]: https://github.com/sebastianbergmann/phpunit/compare/10.0.5...10.0.6
[10.0.5]: https://github.com/sebastianbergmann/phpunit/compare/10.0.4...10.0.5
diff --git a/ChangeLog-9.6.md b/ChangeLog-9.6.md
index 2491e3034b8..5549f9cdb3b 100644
--- a/ChangeLog-9.6.md
+++ b/ChangeLog-9.6.md
@@ -19,7 +19,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil
### Fixed
* [#5073](https://github.com/sebastianbergmann/phpunit/issues/5073): `--no-extensions` CLI option only prevents extension PHARs from being loaded
-* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): PHPUnit 9.6 misses deprecations for assertions and constraints removed in PHPUnit 10
+* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): Deprecate `assertClassHasAttribute()`, `assertClassNotHasAttribute()`, `assertClassHasStaticAttribute()`, `assertClassNotHasStaticAttribute()`, `assertObjectHasAttribute()`, `assertObjectNotHasAttribute()`, `classHasAttribute()`, `classHasStaticAttribute()`, and `objectHasAttribute()`
## [9.6.0] - 2023-02-03
diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php
index 25b746ebab2..4397e6af720 100644
--- a/src/Framework/TestCase.php
+++ b/src/Framework/TestCase.php
@@ -591,13 +591,11 @@ final public function runBare(): void
clearstatcache();
$hookMethods = (new HookMethods)->hookMethods(static::class);
- $hasMetRequirements = false;
$this->numberOfAssertionsPerformed = 0;
$currentWorkingDirectory = getcwd();
try {
$this->checkRequirements();
- $hasMetRequirements = true;
if ($this->inIsolation) {
$this->invokeBeforeClassHookMethods($hookMethods, $emitter);
@@ -620,6 +618,11 @@ final public function runBare(): void
$this->verifyMockObjects();
$this->invokePostConditionHookMethods($hookMethods, $emitter);
+ $this->invokeAfterTestHookMethods($hookMethods, $emitter);
+
+ if ($this->inIsolation) {
+ $this->invokeAfterClassHookMethods($hookMethods, $emitter);
+ }
$this->status = TestStatus::success();
} catch (IncompleteTest $e) {
@@ -675,20 +678,6 @@ final public function runBare(): void
$this->mockObjects = [];
- // Tear down the fixture. An exception raised in tearDown() will be
- // caught and passed on when no exception was raised before.
- try {
- if ($hasMetRequirements) {
- $this->invokeAfterTestHookMethods($hookMethods, $emitter);
-
- if ($this->inIsolation) {
- $this->invokeAfterClassHookMethods($hookMethods, $emitter);
- }
- }
- } catch (Throwable $_e) {
- $e = $e ?? $_e;
- }
-
if (isset($_e)) {
$this->status = TestStatus::error($_e->getMessage());
}
diff --git a/src/Runner/Version.php b/src/Runner/Version.php
index 39f1bf08792..87334bb1afe 100644
--- a/src/Runner/Version.php
+++ b/src/Runner/Version.php
@@ -34,7 +34,7 @@ public static function id(): string
}
if (self::$version === '') {
- self::$version = (new VersionId('10.0.7', dirname(__DIR__, 2)))->asString();
+ self::$version = (new VersionId('10.0.8', dirname(__DIR__, 2)))->asString();
}
return self::$version;
diff --git a/src/TextUI/Help.php b/src/TextUI/Help.php
index bae83135445..1106904bd25 100644
--- a/src/TextUI/Help.php
+++ b/src/TextUI/Help.php
@@ -53,8 +53,8 @@ final class Help
['arg' => '--list-groups', 'desc' => 'List available test groups'],
['arg' => '--group ', 'desc' => 'Only run tests from the specified group(s)'],
['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'],
- ['arg' => '--covers ', 'desc' => 'Only run tests annotated with "@covers "'],
- ['arg' => '--uses ', 'desc' => 'Only run tests annotated with "@uses "'],
+ ['arg' => '--covers ', 'desc' => 'Only run tests that intend to cover '],
+ ['arg' => '--uses ', 'desc' => 'Only run tests that intend to use '],
['arg' => '--list-tests', 'desc' => 'List available tests'],
['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'],
['arg' => '--filter ', 'desc' => 'Filter which tests to run'],
@@ -67,7 +67,7 @@ final class Help
['arg' => '--static-backup', 'desc' => 'Backup and restore static properties for each test'],
['spacer' => ''],
- ['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage attributes and annotations'],
+ ['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage metadata'],
['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'],
['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'],
['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'],
@@ -94,8 +94,8 @@ final class Help
['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'],
['spacer' => ''],
- ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'],
- ['arg' => '--random-order-seed ', 'desc' => 'Use a specific random seed for random order'],
+ ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size'],
+ ['arg' => '--random-order-seed ', 'desc' => 'Use the specified random seed when running tests in random order'],
],
'Reporting' => [
@@ -119,40 +119,40 @@ final class Help
['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'],
['spacer' => ''],
- ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'],
- ['arg' => '--testdox', 'desc' => 'Report test results in TestDox format'],
+ ['arg' => '--teamcity', 'desc' => 'Replace default progress and result output with TeamCity format'],
+ ['arg' => '--testdox', 'desc' => 'Replace default result output with TestDox format'],
],
'Logging' => [
- ['arg' => '--log-junit ', 'desc' => 'Log test execution in JUnit XML format to file'],
- ['arg' => '--log-teamcity ', 'desc' => 'Log test execution in TeamCity format to file'],
- ['arg' => '--testdox-html ', 'desc' => 'Write documentation in HTML format to file'],
- ['arg' => '--testdox-text ', 'desc' => 'Write documentation in Text format to file'],
+ ['arg' => '--log-junit ', 'desc' => 'Write test results in JUnit XML format to file'],
+ ['arg' => '--log-teamcity ', 'desc' => 'Write test results in TeamCity format to file'],
+ ['arg' => '--testdox-html ', 'desc' => 'Write test results in TestDox format (HTML) to file'],
+ ['arg' => '--testdox-text ', 'desc' => 'Write test results in TestDox format (plain text) to file'],
['arg' => '--log-events-text ', 'desc' => 'Stream events as plain text to file'],
- ['arg' => '--log-events-verbose-text ', 'desc' => 'Stream events as plain text to file (with telemetry information)'],
- ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration'],
+ ['arg' => '--log-events-verbose-text ', 'desc' => 'Stream events as plain text (with telemetry information) to file'],
+ ['arg' => '--no-logging', 'desc' => 'Ignore logging configured in the XML configuration file'],
],
'Code Coverage' => [
- ['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'],
- ['arg' => '--coverage-cobertura ', 'desc' => 'Generate code coverage report in Cobertura XML format'],
- ['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'],
- ['arg' => '--coverage-html ', 'desc' => 'Generate code coverage report in HTML format'],
- ['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'],
- ['arg' => '--coverage-text=', 'desc' => 'Generate code coverage report in text format [default: standard output]'],
- ['arg' => '--coverage-xml ', 'desc' => 'Generate code coverage report in PHPUnit XML format'],
+ ['arg' => '--coverage-clover ', 'desc' => 'Write code coverage report in Clover XML format to file'],
+ ['arg' => '--coverage-cobertura ', 'desc' => 'Write code coverage report in Cobertura XML format to file'],
+ ['arg' => '--coverage-crap4j ', 'desc' => 'Write code coverage report in Crap4J XML format to file'],
+ ['arg' => '--coverage-html ', 'desc' => 'Write code coverage report in HTML format to directory'],
+ ['arg' => '--coverage-php ', 'desc' => 'Write serialized code coverage data to file'],
+ ['arg' => '--coverage-text=', 'desc' => 'Write code coverage report in text format to file [default: standard output]'],
+ ['arg' => '--coverage-xml ', 'desc' => 'Write code coverage report in XML format to directory'],
['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'],
- ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage analysis'],
- ['arg' => '--path-coverage', 'desc' => 'Perform path coverage analysis'],
- ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable attributes and annotations for ignoring code coverage'],
- ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration'],
+ ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage reporting'],
+ ['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'],
+ ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'],
+ ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage reporting configured in the XML configuration file'],
],
'Miscellaneous' => [
['arg' => '-h|--help', 'desc' => 'Prints this usage information'],
['arg' => '--version', 'desc' => 'Prints the version and exits'],
- ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than min and exits'],
- ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'],
+ ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than and exits'],
+ ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version and exits'],
],
];
diff --git a/tests/end-to-end/_files/output-cli-help-color.txt b/tests/end-to-end/_files/output-cli-help-color.txt
index c31f6e9eb83..35abf43001a 100644
--- a/tests/end-to-end/_files/output-cli-help-color.txt
+++ b/tests/end-to-end/_files/output-cli-help-color.txt
@@ -28,9 +28,8 @@
[32m--list-groups [0m List available test groups
[32m--group [36m[0m [0m Only run tests from the specified group(s)
[32m--exclude-group [36m[0m [0m Exclude tests from the specified group(s)
- [32m--covers [36m[0m [0m Only run tests annotated with "@covers
- "
- [32m--uses [36m[0m [0m Only run tests annotated with "@uses "
+ [32m--covers [36m[0m [0m Only run tests that intend to cover
+ [32m--uses [36m[0m [0m Only run tests that intend to use
[32m--list-tests [0m List available tests
[32m--list-tests-xml [36m[0m [0m List available tests in XML format
[32m--filter [36m[0m [0m Filter which tests to run
@@ -44,8 +43,7 @@
[32m--static-backup [0m Backup and restore static properties for
each test
- [32m--strict-coverage [0m Be strict about code coverage attributes and
- annotations
+ [32m--strict-coverage [0m Be strict about code coverage metadata
[32m--strict-global-state [0m Be strict about changes to global state
[32m--disallow-test-output [0m Be strict about output during tests
[32m--enforce-time-limit [0m Enforce time limit based on test size
@@ -71,9 +69,9 @@
[32m--do-not-cache-result [0m Do not write test results to cache file
[32m--order-by [36m[0m [0m Run tests in order:
- default|defects|duration|no-depends|random|reverse|size
- [32m--random-order-seed [36m[0m [0m Use a specific random seed for random
- order
+ default|defects|depends|duration|no-depends|random|reverse|size
+ [32m--random-order-seed [36m[0m [0m Use the specified random seed when running
+ tests in random order
[33mReporting:[0m
@@ -100,48 +98,56 @@
tests
[32m--reverse-list [0m Print defects in reverse order
- [32m--teamcity [0m Report test execution progress in TeamCity
+ [32m--teamcity [0m Replace default progress and result output
+ with TeamCity format
+ [32m--testdox [0m Replace default result output with TestDox
format
- [32m--testdox [0m Report test results in TestDox format
[33mLogging:[0m
- [32m--log-junit [36m[0m [0m Log test execution in JUnit XML format to
+ [32m--log-junit [36m[0m [0m Write test results in JUnit XML format to
file
- [32m--log-teamcity [36m[0m [0m Log test execution in TeamCity format to
+ [32m--log-teamcity [36m[0m [0m Write test results in TeamCity format to
file
- [32m--testdox-html [36m[0m [0m Write documentation in HTML format to file
- [32m--testdox-text [36m[0m [0m Write documentation in Text format to file
+ [32m--testdox-html [36m[0m [0m Write test results in TestDox format (HTML)
+ to file
+ [32m--testdox-text [36m[0m [0m Write test results in TestDox format (plain
+ text) to file
[32m--log-events-text [36m[0m [0m Stream events as plain text to file
- [32m--log-events-verbose-text [36m[0m[0m Stream events as plain text to file (with
- telemetry information)
- [32m--no-logging [0m Ignore logging configuration
+ [32m--log-events-verbose-text [36m[0m[0m Stream events as plain text (with telemetry
+ information) to file
+ [32m--no-logging [0m Ignore logging configured in the XML
+ configuration file
[33mCode Coverage:[0m
- [32m--coverage-clover [36m[0m [0m Generate code coverage report in Clover XML
- format
- [32m--coverage-cobertura [36m[0m [0m Generate code coverage report in Cobertura
- XML format
- [32m--coverage-crap4j [36m[0m [0m Generate code coverage report in Crap4J XML
- format
- [32m--coverage-html [36m[0m [0m Generate code coverage report in HTML format
- [32m--coverage-php [36m[0m [0m Export PHP_CodeCoverage object to file
- [32m--coverage-text=[36m[0m [0m Generate code coverage report in text format
- [default: standard output]
- [32m--coverage-xml [36m[0m [0m Generate code coverage report in PHPUnit XML
- format
+ [32m--coverage-clover [36m[0m [0m Write code coverage report in Clover XML
+ format to file
+ [32m--coverage-cobertura [36m[0m [0m Write code coverage report in Cobertura XML
+ format to file
+ [32m--coverage-crap4j [36m[0m [0m Write code coverage report in Crap4J XML
+ format to file
+ [32m--coverage-html [36m[0m [0m Write code coverage report in HTML format to
+ directory
+ [32m--coverage-php [36m[0m [0m Write serialized code coverage data to file
+ [32m--coverage-text=[36m[0m [0m Write code coverage report in text format to
+ file [default: standard output]
+ [32m--coverage-xml [36m[0m [0m Write code coverage report in XML format to
+ directory
[32m--warm-coverage-cache [0m Warm static analysis cache
- [32m--coverage-filter [36m[0m [0m Include in code coverage analysis
- [32m--path-coverage [0m Perform path coverage analysis
- [32m--disable-coverage-ignore [0m Disable attributes and annotations for
- ignoring code coverage
- [32m--no-coverage [0m Ignore code coverage configuration
+ [32m--coverage-filter [36m[0m [0m Include in code coverage reporting
+ [32m--path-coverage [0m Report path coverage in addition to line
+ coverage
+ [32m--disable-coverage-ignore [0m Disable metadata for ignoring code coverage
+ [32m--no-coverage [0m Ignore code coverage reporting configured in
+ the XML configuration file
[33mMiscellaneous:[0m
[32m-h|--help [0m Prints this usage information
[32m--version [0m Prints the version and exits
- [32m--atleast-version [36m[0m [0m Checks that version is greater than min and
- exits
+ [32m--atleast-version [36m[0m [0m Checks that version is greater than
+ and exits
[32m--check-version [0m Check whether PHPUnit is the latest version
+ and exits
+
diff --git a/tests/end-to-end/_files/output-cli-usage.txt b/tests/end-to-end/_files/output-cli-usage.txt
index 1cf353b05fd..30eb64d3112 100644
--- a/tests/end-to-end/_files/output-cli-usage.txt
+++ b/tests/end-to-end/_files/output-cli-usage.txt
@@ -24,8 +24,8 @@ Selection:
--list-groups List available test groups
--group Only run tests from the specified group(s)
--exclude-group Exclude tests from the specified group(s)
- --covers Only run tests annotated with "@covers "
- --uses Only run tests annotated with "@uses "
+ --covers Only run tests that intend to cover
+ --uses Only run tests that intend to use
--list-tests List available tests
--list-tests-xml List available tests in XML format
--filter Filter which tests to run
@@ -37,7 +37,7 @@ Execution:
--globals-backup Backup and restore $GLOBALS for each test
--static-backup Backup and restore static properties for each test
- --strict-coverage Be strict about code coverage attributes and annotations
+ --strict-coverage Be strict about code coverage metadata
--strict-global-state Be strict about changes to global state
--disallow-test-output Be strict about output during tests
--enforce-time-limit Enforce time limit based on test size
@@ -60,8 +60,8 @@ Execution:
--cache-result Write test results to cache file
--do-not-cache-result Do not write test results to cache file
- --order-by Run tests in order: default|defects|duration|no-depends|random|reverse|size
- --random-order-seed Use a specific random seed for random order
+ --order-by Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size
+ --random-order-seed Use the specified random seed when running tests in random order
Reporting:
@@ -82,37 +82,37 @@ Reporting:
--display-warnings Display details for warnings triggered by tests
--reverse-list Print defects in reverse order
- --teamcity Report test execution progress in TeamCity format
- --testdox Report test results in TestDox format
+ --teamcity Replace default progress and result output with TeamCity format
+ --testdox Replace default result output with TestDox format
Logging:
- --log-junit Log test execution in JUnit XML format to file
- --log-teamcity Log test execution in TeamCity format to file
- --testdox-html Write documentation in HTML format to file
- --testdox-text Write documentation in Text format to file
+ --log-junit Write test results in JUnit XML format to file
+ --log-teamcity Write test results in TeamCity format to file
+ --testdox-html Write test results in TestDox format (HTML) to file
+ --testdox-text Write test results in TestDox format (plain text) to file
--log-events-text Stream events as plain text to file
- --log-events-verbose-text Stream events as plain text to file (with telemetry information)
- --no-logging Ignore logging configuration
+ --log-events-verbose-text Stream events as plain text (with telemetry information) to file
+ --no-logging Ignore logging configured in the XML configuration file
Code Coverage:
- --coverage-clover Generate code coverage report in Clover XML format
- --coverage-cobertura Generate code coverage report in Cobertura XML format
- --coverage-crap4j Generate code coverage report in Crap4J XML format
- --coverage-html Generate code coverage report in HTML format
- --coverage-php Export PHP_CodeCoverage object to file
- --coverage-text= Generate code coverage report in text format [default: standard output]
- --coverage-xml Generate code coverage report in PHPUnit XML format
+ --coverage-clover Write code coverage report in Clover XML format to file
+ --coverage-cobertura Write code coverage report in Cobertura XML format to file
+ --coverage-crap4j Write code coverage report in Crap4J XML format to file
+ --coverage-html Write code coverage report in HTML format to directory
+ --coverage-php Write serialized code coverage data to file
+ --coverage-text= Write code coverage report in text format to file [default: standard output]
+ --coverage-xml Write code coverage report in XML format to directory
--warm-coverage-cache Warm static analysis cache
- --coverage-filter Include in code coverage analysis
- --path-coverage Perform path coverage analysis
- --disable-coverage-ignore Disable attributes and annotations for ignoring code coverage
- --no-coverage Ignore code coverage configuration
+ --coverage-filter Include in code coverage reporting
+ --path-coverage Report path coverage in addition to line coverage
+ --disable-coverage-ignore Disable metadata for ignoring code coverage
+ --no-coverage Ignore code coverage reporting configured in the XML configuration file
Miscellaneous:
-h|--help Prints this usage information
--version Prints the version and exits
- --atleast-version Checks that version is greater than min and exits
- --check-version Check whether PHPUnit is the latest version
+ --atleast-version Checks that version is greater than and exits
+ --check-version Check whether PHPUnit is the latest version and exits
diff --git a/tests/end-to-end/event/test-template-methods.phpt b/tests/end-to-end/event/test-template-methods.phpt
index 2a98e17e375..8d92f73de7b 100644
--- a/tests/end-to-end/event/test-template-methods.phpt
+++ b/tests/end-to-end/event/test-template-methods.phpt
@@ -47,10 +47,10 @@ Assertion Succeeded (Constraint: is true)
Post Condition Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::assertPostConditions)
Post Condition Method Finished:
- PHPUnit\TestFixture\Event\TemplateMethodsTest::assertPostConditions
-Test Passed (PHPUnit\TestFixture\Event\TemplateMethodsTest::testOne)
After Test Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::tearDown)
After Test Method Finished:
- PHPUnit\TestFixture\Event\TemplateMethodsTest::tearDown
+Test Passed (PHPUnit\TestFixture\Event\TemplateMethodsTest::testOne)
Test Finished (PHPUnit\TestFixture\Event\TemplateMethodsTest::testOne)
Test Preparation Started (PHPUnit\TestFixture\Event\TemplateMethodsTest::testTwo)
Before Test Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::setUp)
@@ -64,10 +64,10 @@ Assertion Succeeded (Constraint: is true)
Post Condition Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::assertPostConditions)
Post Condition Method Finished:
- PHPUnit\TestFixture\Event\TemplateMethodsTest::assertPostConditions
-Test Passed (PHPUnit\TestFixture\Event\TemplateMethodsTest::testTwo)
After Test Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::tearDown)
After Test Method Finished:
- PHPUnit\TestFixture\Event\TemplateMethodsTest::tearDown
+Test Passed (PHPUnit\TestFixture\Event\TemplateMethodsTest::testTwo)
Test Finished (PHPUnit\TestFixture\Event\TemplateMethodsTest::testTwo)
After Last Test Method Called (PHPUnit\TestFixture\Event\TemplateMethodsTest::tearDownAfterClass)
After Last Test Method Finished:
diff --git a/tests/end-to-end/regression/5192.phpt b/tests/end-to-end/regression/5192.phpt
new file mode 100644
index 00000000000..3a159514270
--- /dev/null
+++ b/tests/end-to-end/regression/5192.phpt
@@ -0,0 +1,16 @@
+--TEST--
+https://github.com/sebastianbergmann/phpunit/issues/5192
+--FILE--
+run($_SERVER['argv']);
+--XFAIL--
+https://github.com/sebastianbergmann/phpunit/issues/5192
+--EXPECTF--
+PHPUnit %s by Sebastian Bergmann and contributors.
+
+No tests executed!
diff --git a/tests/end-to-end/regression/5192/phpunit.xml b/tests/end-to-end/regression/5192/phpunit.xml
new file mode 100644
index 00000000000..0dbd87e2524
--- /dev/null
+++ b/tests/end-to-end/regression/5192/phpunit.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ tests
+
+
+
diff --git a/tests/end-to-end/regression/5192/tests/.gitkeep b/tests/end-to-end/regression/5192/tests/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/tests/end-to-end/regression/5210.phpt b/tests/end-to-end/regression/5210.phpt
new file mode 100644
index 00000000000..efac9e93d50
--- /dev/null
+++ b/tests/end-to-end/regression/5210.phpt
@@ -0,0 +1,29 @@
+--TEST--
+https://github.com/sebastianbergmann/phpunit/issues/5210
+--FILE--
+run($_SERVER['argv']);
+--EXPECTF--
+PHPUnit %s by Sebastian Bergmann and contributors.
+
+Runtime: %s
+
+E 1 / 1 (100%)
+
+Time: %s, Memory: %s
+
+There was 1 error:
+
+1) Issue5210Test::testOne
+Exception: test
+
+%s:%d
+
+ERRORS!
+Tests: 1, Assertions: 1, Errors: 1.
diff --git a/tests/end-to-end/regression/5210/Issue5210Test.php b/tests/end-to-end/regression/5210/Issue5210Test.php
new file mode 100644
index 00000000000..85ed03f978c
--- /dev/null
+++ b/tests/end-to-end/regression/5210/Issue5210Test.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+use PHPUnit\Framework\TestCase;
+
+final class Issue5210Test extends TestCase
+{
+ protected function tearDown(): void
+ {
+ throw new \Exception('test');
+ }
+
+ public function testOne(): void
+ {
+ $this->assertTrue(true);
+ }
+}
diff --git a/tools/composer b/tools/composer
index decd0873c2e..cc434ae5878 100755
Binary files a/tools/composer and b/tools/composer differ
diff --git a/tools/php-cs-fixer b/tools/php-cs-fixer
index 7f455dcb1fa..6e70d2d9fea 100755
Binary files a/tools/php-cs-fixer and b/tools/php-cs-fixer differ
diff --git a/tools/phpab b/tools/phpab
index e2ca8045ceb..1fbfb99b7bb 100755
--- a/tools/phpab
+++ b/tools/phpab
@@ -128,12 +128,10 @@ spl_autoload_register(
'theseer\\autoload\\parserinterface' => '/phpab/ParserInterface.php',
'theseer\\autoload\\pathcomparator' => '/phpab/PathComparator.php',
'theseer\\autoload\\pharbuilder' => '/phpab/PharBuilder.php',
- 'theseer\\autoload\\runner' => '/phpab/Runner.php',
'theseer\\autoload\\sourcefile' => '/phpab/SourceFile.php',
'theseer\\autoload\\staticlistrenderer' => '/phpab/StaticListRenderer.php',
'theseer\\autoload\\staticrenderer' => '/phpab/StaticRenderer.php',
'theseer\\autoload\\staticrequirelistrenderer' => '/phpab/StaticRequireListRenderer.php',
- 'theseer\\autoload\\unitvisitor' => '/phpab/UnitVisitor.php',
'theseer\\autoload\\version' => '/phpab/Version.php',
'theseer\\directoryscanner\\directoryscanner' => '/vendor/theseer/directoryscanner/src/directoryscanner.php',
'theseer\\directoryscanner\\exception' => '/vendor/theseer/directoryscanner/src/directoryscanner.php',
@@ -152,22 +150,22 @@ spl_autoload_register(
);
Phar::mapPhar('phpab.phar');
-define('PHPAB_VERSION', '1.27.1');
+define('PHPAB_VERSION', '1.27.2');
$factory = new \TheSeer\Autoload\Factory();
$factory->getCLI()->run();
exit(0);
__HALT_COMPILER(); ?>
-*
- phpab.phar 8 vendor/theseer/directoryscanner/src/directoryscanner.php" aA P 7 vendor/theseer/directoryscanner/src/filesonlyfilter.php
- a ;l <