From 6420191c22ba5a55f61a36442b7cae6d306e8e5c Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sun, 28 May 2023 08:43:19 +0200 Subject: [PATCH 1/3] Closes #5394 --- tests/end-to-end/_files/groups/phpunit.xml | 10 ++++++ .../_files/groups/tests/FooTest.php | 36 +++++++++++++++++++ ... => exclude-group-argument-isolation.phpt} | 13 ++++--- ...group.phpt => exclude-group-argument.phpt} | 13 ++++--- ...exclude-group-configuration-isolation.phpt | 24 +++++++++++++ .../cli/exclude-group-configuration.phpt | 23 ++++++++++++ ...ion.phpt => group-argument-isolation.phpt} | 11 +++--- tests/end-to-end/cli/group-argument.phpt | 23 ++++++++++++ .../cli/group-configuration-isolation.phpt | 24 +++++++++++++ tests/end-to-end/cli/group-configuration.phpt | 23 ++++++++++++ tests/end-to-end/cli/group.phpt | 23 ------------ ...-groups.phpt => list-groups-argument.phpt} | 10 +++--- .../cli/list-groups-configuration.phpt | 18 ++++++++++ 13 files changed, 209 insertions(+), 42 deletions(-) create mode 100644 tests/end-to-end/_files/groups/phpunit.xml create mode 100644 tests/end-to-end/_files/groups/tests/FooTest.php rename tests/end-to-end/cli/{exclude-group-isolation.phpt => exclude-group-argument-isolation.phpt} (52%) rename tests/end-to-end/cli/{exclude-group.phpt => exclude-group-argument.phpt} (51%) create mode 100644 tests/end-to-end/cli/exclude-group-configuration-isolation.phpt create mode 100644 tests/end-to-end/cli/exclude-group-configuration.phpt rename tests/end-to-end/cli/{group-isolation.phpt => group-argument-isolation.phpt} (57%) create mode 100644 tests/end-to-end/cli/group-argument.phpt create mode 100644 tests/end-to-end/cli/group-configuration-isolation.phpt create mode 100644 tests/end-to-end/cli/group-configuration.phpt delete mode 100644 tests/end-to-end/cli/group.phpt rename tests/end-to-end/cli/{list-groups.phpt => list-groups-argument.phpt} (63%) create mode 100644 tests/end-to-end/cli/list-groups-configuration.phpt diff --git a/tests/end-to-end/_files/groups/phpunit.xml b/tests/end-to-end/_files/groups/phpunit.xml new file mode 100644 index 00000000000..8b2df97afce --- /dev/null +++ b/tests/end-to-end/_files/groups/phpunit.xml @@ -0,0 +1,10 @@ + + + + + tests + + + diff --git a/tests/end-to-end/_files/groups/tests/FooTest.php b/tests/end-to-end/_files/groups/tests/FooTest.php new file mode 100644 index 00000000000..818255ee197 --- /dev/null +++ b/tests/end-to-end/_files/groups/tests/FooTest.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TestFixture\Groups; + +use PHPUnit\Framework\TestCase; + +final class FooTest extends TestCase +{ + /** + * @group one + */ + public function testOne(): void + { + $this->assertTrue(true); + } + + /** + * @group two + */ + public function testTwo(): void + { + $this->assertTrue(true); + } + + public function testThree(): void + { + $this->assertTrue(true); + } +} diff --git a/tests/end-to-end/cli/exclude-group-isolation.phpt b/tests/end-to-end/cli/exclude-group-argument-isolation.phpt similarity index 52% rename from tests/end-to-end/cli/exclude-group-isolation.phpt rename to tests/end-to-end/cli/exclude-group-argument-isolation.phpt index 3c5b4ab86b5..56c7b87916b 100644 --- a/tests/end-to-end/cli/exclude-group-isolation.phpt +++ b/tests/end-to-end/cli/exclude-group-argument-isolation.phpt @@ -1,21 +1,24 @@ --TEST-- -phpunit --process-isolation --exclude-group balanceIsInitiallyZero ../../_files/BankAccountTest.php +phpunit --process-isolation --exclude-group one,two tests/FooTest.php --FILE-- Date: Sun, 28 May 2023 08:53:07 +0200 Subject: [PATCH 2/3] Also test --filter option with both configuration and argument --- .../cli/filter-class-isolation.phpt | 21 --------------- .../cli/filter-class-match-argument.phpt | 27 +++++++++++++++++++ .../cli/filter-class-match-configuration.phpt | 27 +++++++++++++++++++ .../cli/filter-class-nomatch-argument.phpt | 17 ++++++++++++ .../filter-class-nomatch-configuration.phpt | 17 ++++++++++++ ...phpt => filter-method-match-argument.phpt} | 13 +++++---- .../filter-method-match-configuration.phpt | 23 ++++++++++++++++ .../cli/filter-method-nomatch-argument.phpt | 17 ++++++++++++ .../filter-method-nomatch-configuration.phpt | 17 ++++++++++++ 9 files changed, 153 insertions(+), 26 deletions(-) delete mode 100644 tests/end-to-end/cli/filter-class-isolation.phpt create mode 100644 tests/end-to-end/cli/filter-class-match-argument.phpt create mode 100644 tests/end-to-end/cli/filter-class-match-configuration.phpt create mode 100644 tests/end-to-end/cli/filter-class-nomatch-argument.phpt create mode 100644 tests/end-to-end/cli/filter-class-nomatch-configuration.phpt rename tests/end-to-end/cli/{filter-class.phpt => filter-method-match-argument.phpt} (51%) create mode 100644 tests/end-to-end/cli/filter-method-match-configuration.phpt create mode 100644 tests/end-to-end/cli/filter-method-nomatch-argument.phpt create mode 100644 tests/end-to-end/cli/filter-method-nomatch-configuration.phpt diff --git a/tests/end-to-end/cli/filter-class-isolation.phpt b/tests/end-to-end/cli/filter-class-isolation.phpt deleted file mode 100644 index be96919f1bb..00000000000 --- a/tests/end-to-end/cli/filter-class-isolation.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -phpunit --process-isolation --filter BankAccountTest ../../_files/BankAccountTest.php ---FILE-- - Date: Sun, 28 May 2023 08:54:30 +0200 Subject: [PATCH 3/3] Delete superfluous tests --- .../cli/exclude-group-argument-isolation.phpt | 24 ------------------- ...exclude-group-configuration-isolation.phpt | 24 ------------------- ...ider-by-classname-and-range-isolation.phpt | 21 ---------------- ...lter-dataprovider-by-number-isolation.phpt | 21 ---------------- ...-dataprovider-by-only-range-isolation.phpt | 21 ---------------- ...dataprovider-by-only-regexp-isolation.phpt | 21 ---------------- ...dataprovider-by-only-string-isolation.phpt | 21 ---------------- ...ilter-dataprovider-by-range-isolation.phpt | 21 ---------------- ...lter-dataprovider-by-regexp-isolation.phpt | 21 ---------------- ...lter-dataprovider-by-string-isolation.phpt | 21 ---------------- .../cli/filter-method-isolation.phpt | 21 ---------------- tests/end-to-end/cli/filter-method.phpt | 20 ---------------- tests/end-to-end/cli/filter-no-results.phpt | 16 ------------- .../cli/group-argument-isolation.phpt | 24 ------------------- .../cli/group-configuration-isolation.phpt | 24 ------------------- 15 files changed, 321 deletions(-) delete mode 100644 tests/end-to-end/cli/exclude-group-argument-isolation.phpt delete mode 100644 tests/end-to-end/cli/exclude-group-configuration-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-classname-and-range-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-number-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-only-range-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-only-regexp-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-only-string-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-range-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-regexp-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-dataprovider-by-string-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-method-isolation.phpt delete mode 100644 tests/end-to-end/cli/filter-method.phpt delete mode 100644 tests/end-to-end/cli/filter-no-results.phpt delete mode 100644 tests/end-to-end/cli/group-argument-isolation.phpt delete mode 100644 tests/end-to-end/cli/group-configuration-isolation.phpt diff --git a/tests/end-to-end/cli/exclude-group-argument-isolation.phpt b/tests/end-to-end/cli/exclude-group-argument-isolation.phpt deleted file mode 100644 index 56c7b87916b..00000000000 --- a/tests/end-to-end/cli/exclude-group-argument-isolation.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -phpunit --process-isolation --exclude-group one,two tests/FooTest.php ---FILE-- -