From ed44a9beae54c3928b9298f3a98c9919742b62a9 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 4 Feb 2023 09:04:37 +0100 Subject: [PATCH 1/5] Add test for #5164 --- tests/end-to-end/regression/5164.phpt | 36 +++++++++++++++++++ .../regression/5164/Issue5164Test.php | 18 ++++++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/end-to-end/regression/5164.phpt create mode 100644 tests/end-to-end/regression/5164/Issue5164Test.php diff --git a/tests/end-to-end/regression/5164.phpt b/tests/end-to-end/regression/5164.phpt new file mode 100644 index 00000000000..9b0033dfd76 --- /dev/null +++ b/tests/end-to-end/regression/5164.phpt @@ -0,0 +1,36 @@ +--TEST-- +https://github.com/sebastianbergmann/phpunit/issues/5164 +--FILE-- + Date: Sat, 4 Feb 2023 09:20:43 +0100 Subject: [PATCH 2/5] Fix CS/WS issues --- tests/end-to-end/regression/5164/Issue5164Test.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/end-to-end/regression/5164/Issue5164Test.php b/tests/end-to-end/regression/5164/Issue5164Test.php index 42768d1393f..b5c0ecf625b 100644 --- a/tests/end-to-end/regression/5164/Issue5164Test.php +++ b/tests/end-to-end/regression/5164/Issue5164Test.php @@ -1,4 +1,12 @@ + * + * 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 Issue5164Test extends TestCase From 385b4d1e95d64d29e483d432b38a633aab2e407e Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 4 Feb 2023 09:34:25 +0100 Subject: [PATCH 3/5] Fix expectation --- tests/end-to-end/regression/5164.phpt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/end-to-end/regression/5164.phpt b/tests/end-to-end/regression/5164.phpt index 9b0033dfd76..6478b1b742f 100644 --- a/tests/end-to-end/regression/5164.phpt +++ b/tests/end-to-end/regression/5164.phpt @@ -22,15 +22,15 @@ Time: %s, Memory: %s There were 2 skipped tests: -1) Issue5074Test::testOne +1) Issue5164Test::testOne message -%sIssue5074Test.php:%d +%sIssue5164Test.php:%d -2) Issue5074Test::testTwo +2) Issue5164Test::testTwo message -%sIssue5074Test.php:%d +%sIssue5164Test.php:%d OK, but incomplete, skipped, or risky tests! Tests: 2, Assertions: 0, Skipped: 2. From 8072151d4782529eca00770db6dccbb49ce4cdb1 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 4 Feb 2023 09:53:49 +0100 Subject: [PATCH 4/5] Closes #5164 --- ChangeLog-9.6.md | 7 +++++++ src/Framework/TestSuite.php | 2 +- tests/end-to-end/regression/5164.phpt | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog-9.6.md b/ChangeLog-9.6.md index 0f785d38423..a8ad6495a73 100644 --- a/ChangeLog-9.6.md +++ b/ChangeLog-9.6.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [9.6.3] - 2023-MM-DD + +### Fixed + +* [#5164](https://github.com/sebastianbergmann/phpunit/issues/5164): `markTestSkipped()` not handled correctly when called in "before first test" method + ## [9.6.2] - 2023-02-04 ### Fixed @@ -24,6 +30,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil * [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` * [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes +[9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6 [9.6.2]: https://github.com/sebastianbergmann/phpunit/compare/9.6.1...9.6.2 [9.6.1]: https://github.com/sebastianbergmann/phpunit/compare/9.6.0...9.6.1 [9.6.0]: https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.0 diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php index a51538b18d0..e7cef62ee4f 100644 --- a/src/Framework/TestSuite.php +++ b/src/Framework/TestSuite.php @@ -628,7 +628,7 @@ public function run(TestResult $result = null): TestResult call_user_func([$this->name, $beforeClassMethod]); } } - } catch (SkippedTestSuiteError $error) { + } catch (SkippedTestSuiteError|SkippedTestError $error) { foreach ($this->tests() as $test) { $result->startTest($test); $result->addFailure($test, $error, 0); diff --git a/tests/end-to-end/regression/5164.phpt b/tests/end-to-end/regression/5164.phpt index 6478b1b742f..1b61e899a82 100644 --- a/tests/end-to-end/regression/5164.phpt +++ b/tests/end-to-end/regression/5164.phpt @@ -9,8 +9,6 @@ $_SERVER['argv'][] = __DIR__ . '/5164/Issue5164Test.php'; require_once __DIR__ . '/../../bootstrap.php'; PHPUnit\TextUI\Command::main(); ---XFAIL-- -https://github.com/sebastianbergmann/phpunit/issues/5164 --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. From e7b1615e3e887d6c719121c6d4a44b0ab9645555 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 4 Feb 2023 14:37:15 +0100 Subject: [PATCH 5/5] Prepare release --- ChangeLog-9.6.md | 4 ++-- src/Runner/Version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog-9.6.md b/ChangeLog-9.6.md index a8ad6495a73..2491e3034b8 100644 --- a/ChangeLog-9.6.md +++ b/ChangeLog-9.6.md @@ -2,7 +2,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. -## [9.6.3] - 2023-MM-DD +## [9.6.3] - 2023-02-04 ### Fixed @@ -30,7 +30,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil * [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` * [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes -[9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6 +[9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6.3 [9.6.2]: https://github.com/sebastianbergmann/phpunit/compare/9.6.1...9.6.2 [9.6.1]: https://github.com/sebastianbergmann/phpunit/compare/9.6.0...9.6.1 [9.6.0]: https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.0 diff --git a/src/Runner/Version.php b/src/Runner/Version.php index 87aee6b0182..70de30249b1 100644 --- a/src/Runner/Version.php +++ b/src/Runner/Version.php @@ -41,7 +41,7 @@ public static function id(): string } if (self::$version === '') { - self::$version = (new VersionId('9.6.2', dirname(__DIR__, 2)))->getVersion(); + self::$version = (new VersionId('9.6.3', dirname(__DIR__, 2)))->getVersion(); } return self::$version;