diff --git a/src/Runner/Filter/GroupFilterIterator.php b/src/Runner/Filter/GroupFilterIterator.php index e0c29c1cd93..1d204ada879 100644 --- a/src/Runner/Filter/GroupFilterIterator.php +++ b/src/Runner/Filter/GroupFilterIterator.php @@ -25,7 +25,7 @@ public function __construct(RecursiveIterator $iterator, array $groups, TestSuit parent::__construct($iterator); foreach ($suite->getGroupDetails() as $group => $tests) { - if (\in_array($group, $groups, true)) { + if (\in_array((string) $group, $groups, true)) { $testHashes = \array_map( 'spl_object_hash', $tests diff --git a/tests/_files/NumericGroupAnnotationTest.php b/tests/_files/NumericGroupAnnotationTest.php new file mode 100644 index 00000000000..9a48f9cf8b8 --- /dev/null +++ b/tests/_files/NumericGroupAnnotationTest.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +class NumericGroupAnnotationTest extends \PHPUnit\Framework\TestCase +{ + /** + * @testdox Empty test for @ticket numeric annotation values + * @ticket 3502 + * + * @see https://github.com/sebastianbergmann/phpunit/issues/3502 + */ + public function testTicketAnnotationSupportsNumericValue(): void + { + $this->assertTrue(true); + } + + /** + * @testdox Empty test for @group numeric annotation values + * @group 3502 + * + * @see https://github.com/sebastianbergmann/phpunit/issues/3502 + */ + public function testGroupAnnotationSupportsNumericValue(): void + { + $this->assertTrue(true); + } + + public function testDummyTestThatShouldNotRun(): void + { + $this->doesNotPerformAssertions(); + } +} diff --git a/tests/end-to-end/group.phpt b/tests/end-to-end/group.phpt index 0e452a8c708..ba154c84d7b 100644 --- a/tests/end-to-end/group.phpt +++ b/tests/end-to-end/group.phpt @@ -3,18 +3,21 @@ phpunit --group balanceIsInitiallyZero BankAccountTest ../../_files/BankAccountT --FILE--