diff --git a/src/Repositories/TestRepository.php b/src/Repositories/TestRepository.php index cfce2cf1d..3bd5b82e4 100644 --- a/src/Repositories/TestRepository.php +++ b/src/Repositories/TestRepository.php @@ -209,6 +209,18 @@ private function make(TestCaseFactory $testCase): void $method->groups = [...$groups, ...$method->groups]; } + if ($groups === []) { + foreach ($testCase->methods as $method) { + if ($method->groups === []) { + $method->groups[] = 'default'; + $method->attributes[] = new Attribute( + Group::class, + ['default'], + ); + } + } + } + foreach (['__addBeforeAll', '__addBeforeEach', '__addAfterEach', '__addAfterAll'] as $index => $name) { foreach ($hooks[$index] ?? [null] as $hook) { $testCase->factoryProxies->add($testCase->filename, 0, $name, [$hook]);