diff --git a/src/TextUI/Command/Commands/ListGroupsCommand.php b/src/TextUI/Command/Commands/ListGroupsCommand.php index 70804bbac70..3cff3d17c4d 100644 --- a/src/TextUI/Command/Commands/ListGroupsCommand.php +++ b/src/TextUI/Command/Commands/ListGroupsCommand.php @@ -70,13 +70,13 @@ public function execute(): Result ); foreach ($groups as $group => $numberOfTests) { - if (str_starts_with($group, '__phpunit_')) { + if (str_starts_with((string) $group, '__phpunit_')) { continue; } $buffer .= sprintf( ' - %s (%d test%s)' . PHP_EOL, - $group, + (string) $group, $numberOfTests, $numberOfTests > 1 ? 's' : '', ); diff --git a/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php b/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php index bfb095d3883..99fab1be3b6 100644 --- a/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php +++ b/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php @@ -108,7 +108,7 @@ public function execute(): Result foreach ($groups as $groupName => $testIds) { $writer->startElement('group'); - $writer->writeAttribute('name', $groupName); + $writer->writeAttribute('name', (string) $groupName); foreach ($testIds as $testId) { $writer->startElement('test'); diff --git a/tests/end-to-end/_files/listing-tests-and-groups/ExampleTest.php b/tests/end-to-end/_files/listing-tests-and-groups/ExampleTest.php index 2c3c3c99b84..d4f783d722f 100644 --- a/tests/end-to-end/_files/listing-tests-and-groups/ExampleTest.php +++ b/tests/end-to-end/_files/listing-tests-and-groups/ExampleTest.php @@ -25,4 +25,10 @@ public function testTwo(): void { $this->assertTrue(true); } + + #[Group('3')] + public function testThree(): void + { + $this->assertTrue(true); + } } diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-filter.phpt index 30e88fdee42..89827356532 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-exclude-filter.phpt @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -Available test group: +Available test groups: + - 3 (1 test) - two (1 test) 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 f3558ee4c63..ee4abaffdbc 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 @@ -16,5 +16,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available test groups: + - 3 (1 test) - default (1 test) - two (1 test) diff --git a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-include-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-include-filter.phpt index 30e88fdee42..89827356532 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-groups-include-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-groups-include-filter.phpt @@ -15,5 +15,6 @@ require_once __DIR__ . '/../../../bootstrap.php'; --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -Available test group: +Available test groups: + - 3 (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 fcb77b4edb3..449f5d365e0 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 @@ -14,6 +14,7 @@ require_once __DIR__ . '/../../../bootstrap.php'; PHPUnit %s by Sebastian Bergmann and contributors. Available test groups: + - 3 (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-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-filter.phpt index 17b6b8b5d7f..80fcfb60c8e 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-exclude-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\ExampleTest::testTwo + - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree 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 825ccf63c6b..0d0eccd8447 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 @@ -17,4 +17,5 @@ PHPUnit %s by Sebastian Bergmann and contributors. Available tests: - 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-xml-exclude-filter.phpt b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-filter.phpt index 8e2b4df05f6..00546a2c6ff 100644 --- a/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-filter.phpt +++ b/tests/end-to-end/cli/listing-tests-and-groups/list-tests-xml-exclude-filter.phpt @@ -21,9 +21,13 @@ PHPUnit %s by Sebastian Bergmann and contributors. + + + + 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 6357a72a825..9b6dec2cd48 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 @@ -21,10 +21,14 @@ 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 ff423cf6f09..2be58670f44 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 @@ -21,10 +21,14 @@ 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 8946bb63b6d..e443b7331bd 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 @@ -16,4 +16,5 @@ PHPUnit %s by Sebastian Bergmann and contributors. Available tests: - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testOne - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testTwo + - PHPUnit\TestFixture\ListingTestsAndGroups\ExampleTest::testThree - %sexample.phpt