Skip to content

Commit 6ce011b

Browse files
Closes #4489
1 parent f1649d0 commit 6ce011b

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

ChangeLog-9.4.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 9.4 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [9.4.4] - 2020-MM-DD
6+
7+
### Fixed
8+
9+
* [#4489](https://github.com/sebastianbergmann/phpunit/issues/4489): Numeric group names are not handled correctly
10+
511
## [9.4.3] - 2020-11-10
612

713
### Fixed
@@ -38,6 +44,7 @@ All notable changes of the PHPUnit 9.4 release series are documented in this fil
3844

3945
* The PHPUnit XML configuration generator (that is invoked using the `--generate-configuration` CLI option) now asks for a cache directory (default: `.phpunit.cache`)
4046

47+
[9.4.4]: https://github.com/sebastianbergmann/phpunit/compare/9.4.3...9.4
4148
[9.4.3]: https://github.com/sebastianbergmann/phpunit/compare/9.4.2...9.4.3
4249
[9.4.2]: https://github.com/sebastianbergmann/phpunit/compare/9.4.1...9.4.2
4350
[9.4.1]: https://github.com/sebastianbergmann/phpunit/compare/9.4.0...9.4.1

src/Framework/TestSuite.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use const PHP_EOL;
1313
use function array_diff;
1414
use function array_keys;
15+
use function array_map;
1516
use function array_merge;
1617
use function array_unique;
1718
use function basename;
@@ -78,7 +79,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test
7879
/**
7980
* The test groups of the test suite.
8081
*
81-
* @var array
82+
* @psalm-var array<string,list<Test>>
8283
*/
8384
protected $groups = [];
8485

@@ -556,10 +557,17 @@ public function getName(): string
556557

557558
/**
558559
* Returns the test groups of the suite.
560+
*
561+
* @psalm-return list<string>
559562
*/
560563
public function getGroups(): array
561564
{
562-
return array_keys($this->groups);
565+
return array_map(
566+
static function ($key): string {
567+
return (string) $key;
568+
},
569+
array_keys($this->groups)
570+
);
563571
}
564572

565573
public function getGroupDetails(): array

tests/_files/BankAccountTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected function setUp(): void
2424
* @covers BankAccount::getBalance
2525
* @group balanceIsInitiallyZero
2626
* @group specification
27+
* @group 1234
2728
*/
2829
public function testBalanceIsInitiallyZero(): void
2930
{

tests/end-to-end/list-groups.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PHPUnit\TextUI\Command::main();
1212
PHPUnit %s by Sebastian Bergmann and contributors.
1313

1414
Available test group(s):
15+
- 1234
1516
- balanceCannotBecomeNegative
1617
- balanceIsInitiallyZero
1718
- specification

0 commit comments

Comments
 (0)