diff --git a/core/modules/simpletest/src/TestDiscovery.php b/core/modules/simpletest/src/TestDiscovery.php index b9261a9..d44b015 100644 --- a/core/modules/simpletest/src/TestDiscovery.php +++ b/core/modules/simpletest/src/TestDiscovery.php @@ -321,8 +321,13 @@ public static function getTestInfo($classname, $doc_comment = NULL) { // Concrete tests must have a group. throw new MissingGroupException(sprintf('Missing @group annotation in %s', $classname)); } - // Standardise the group name. - $info['group'] = Unicode::ucfirst($annotations['group']); + // Force all PHPUnit tests into the same group. + if (strpos($classname, 'Drupal\\Tests\\') === 0) { + $info['group'] = 'PHPUnit'; + } + else { + $info['group'] = $annotations['group']; + } if (!empty($annotations['coversDefaultClass'])) { $info['description'] = 'Tests ' . $annotations['coversDefaultClass'] . '.'; diff --git a/core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php b/core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php index 673a213..03a87b7 100644 --- a/core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php +++ b/core/modules/simpletest/tests/src/Unit/TestInfoParsingTest.php @@ -24,7 +24,7 @@ public function infoParserProvider() { // Expected result. [ 'name' => 'Drupal\Tests\simpletest\Unit\TestInfoParsingTest', - 'group' => 'Simpletest', + 'group' => 'PHPUnit', 'description' => 'Tests \Drupal\simpletest\TestDiscovery.', ], // Classname. @@ -35,7 +35,7 @@ public function infoParserProvider() { // Expected result. [ 'name' => 'Drupal\field\Tests\BulkDeleteTest', - 'group' => 'Field', + 'group' => 'field', 'description' => 'Bulk delete storages and fields, and clean up afterwards.', ], // Classname. @@ -63,7 +63,7 @@ public function infoParserProvider() { "/** * Bulk delete storages and fields, and clean up afterwards. * - * @group test + * @group Test * @group field */ ", @@ -74,7 +74,7 @@ public function infoParserProvider() { // Expected result. [ 'name' => 'Drupal\field\Tests\BulkDeleteTest', - 'group' => 'Field', + 'group' => 'field', 'description' => 'Bulk delete storages and fields, and clean up afterwards.', 'requires' => ['module' => ['test']], ], @@ -95,7 +95,7 @@ public function infoParserProvider() { // Expected result. [ 'name' => 'Drupal\field\Tests\BulkDeleteTest', - 'group' => 'Field', + 'group' => 'field', 'description' => 'Bulk delete storages and fields, and clean up afterwards.', 'requires' => ['module' => ['test', 'test1', 'test2']], ], @@ -116,7 +116,7 @@ public function infoParserProvider() { // Expected result. [ 'name' => 'Drupal\field\Tests\BulkDeleteTest', - 'group' => 'Field', + 'group' => 'field', 'description' => 'Bulk delete storages and fields, and clean up afterwards. And the summary line continues and there is no gap to the annotation.', ], // Classname.