diff --git a/composer.json b/composer.json index b666777dd47..6c9225e2428 100644 --- a/composer.json +++ b/composer.json @@ -110,7 +110,8 @@ "tests/_files/CoverageNamespacedFunctionTest.php", "tests/_files/CoveredFunction.php", "tests/_files/Generator.php", - "tests/_files/NamespaceCoveredFunction.php" + "tests/_files/NamespaceCoveredFunction.php", + "tests/end-to-end/_files/listing-tests-and-groups/ExampleAbstractTestCase.php" ] }, "extra": { diff --git a/tests/end-to-end/_files/listing-tests-and-groups/ExampleAbstractTestCase.php b/tests/end-to-end/_files/listing-tests-and-groups/ExampleAbstractTestCase.php new file mode 100644 index 00000000000..2b1977896c6 --- /dev/null +++ b/tests/end-to-end/_files/listing-tests-and-groups/ExampleAbstractTestCase.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TestFixture\ListingTestsAndGroups; + +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\TestCase; + +abstract class ExampleAbstractTestCase extends TestCase +{ + #[Group('abstract-one')] + public function testOne(): void + { + $this->assertTrue(true); + } +} diff --git a/tests/end-to-end/_files/listing-tests-and-groups/ExampleExtendingAbstractTest.php b/tests/end-to-end/_files/listing-tests-and-groups/ExampleExtendingAbstractTest.php new file mode 100644 index 00000000000..01e316b4757 --- /dev/null +++ b/tests/end-to-end/_files/listing-tests-and-groups/ExampleExtendingAbstractTest.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\TestFixture\ListingTestsAndGroups; + +final class ExampleExtendingAbstractTest extends ExampleAbstractTestCase +{ +} diff --git a/tests/end-to-end/cli/list-test-files/list-test-files-exclude-group.phpt b/tests/end-to-end/cli/list-test-files/list-test-files-exclude-group.phpt index f6a2a36e873..1f76ba5bdf3 100644 --- a/tests/end-to-end/cli/list-test-files/list-test-files-exclude-group.phpt +++ b/tests/end-to-end/cli/list-test-files/list-test-files-exclude-group.phpt @@ -14,5 +14,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available test files: + - %slisting-tests-and-groups%sExampleExtendingAbstractTest.php - %slisting-tests-and-groups%sExampleTest.php - %slisting-tests-and-groups%sexample.phpt diff --git a/tests/end-to-end/cli/list-test-files/list-test-files.phpt b/tests/end-to-end/cli/list-test-files/list-test-files.phpt index 7ef216de7bf..5b92fad3d44 100644 --- a/tests/end-to-end/cli/list-test-files/list-test-files.phpt +++ b/tests/end-to-end/cli/list-test-files/list-test-files.phpt @@ -12,5 +12,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available test files: + - %slisting-tests-and-groups%sExampleExtendingAbstractTest.php - %slisting-tests-and-groups%sExampleTest.php - %slisting-tests-and-groups%sexample.phpt diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-group.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-group.phpt index ee4abaffdbc..83f38e04a7e 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-group.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-group.phpt @@ -17,5 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. Available test groups: - 3 (1 test) + - abstract-one (1 test) - default (1 test) - two (1 test) diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-groups.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-groups.phpt index 449f5d365e0..707eaa102c5 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-groups.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-groups.phpt @@ -15,6 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. Available test groups: - 3 (1 test) + - abstract-one (1 test) - default (1 test) - one (1 test) - two (1 test) diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-group.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-group.phpt index 0d0eccd8447..4e4ca2d7464 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-group.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-group.phpt @@ -16,6 +16,7 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available tests: + - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree - %sexample.phpt diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-include-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-include-filter.phpt index 463921a4a28..1ee4053afc6 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-include-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-include-filter.phpt @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -Available test: +Available tests: + - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-group.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-group.phpt index 9b6dec2cd48..31251a68377 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-group.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-group.phpt @@ -19,6 +19,9 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + @@ -29,6 +32,9 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-include-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-include-filter.phpt index cfe0bdea686..0807d5987e7 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-include-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-include-filter.phpt @@ -19,11 +19,17 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + + + + diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml.phpt index 2be58670f44..420d1753bd9 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml.phpt @@ -18,6 +18,9 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + @@ -29,6 +32,9 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-tests.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests.phpt index e443b7331bd..486a7f49e7d 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests.phpt @@ -14,6 +14,7 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available tests: + - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleExtendingAbstractTest::testOne - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree