{"record":{"id":"592ba4d317b05c47","repo":"pestphp/pest","slug":"the-test-case-s-may-not-be-used-here-the-folde","errorCode":null,"errorMessage":"The test case [%s] may not be used here. The folder [%s] is already bound to the test case [%s].","messagePattern":"The test case \\[(.+?)\\] may not be used here\\. The folder \\[(.+?)\\] is already bound to the test case \\[(.+?)\\]\\.","errorType":"exception","errorClass":"TestCaseAlreadyInUse","httpStatus":null,"severity":"error","filePath":"src/Repositories/TestRepository.php","lineNumber":164,"sourceCode":"            }\n        }\n\n        $this->make($this->testCases[$filename]);\n    }\n\n    private function make(TestCaseFactory $testCase): void\n    {\n        $startsWith = static fn (string $target, string $directory): bool => Str::startsWith($target, $directory.DIRECTORY_SEPARATOR);\n\n        foreach ($this->uses as $path => $uses) {\n            [$classOrTraits, $groups, $hooks] = $uses;\n\n            if ((! is_dir($path) && $testCase->filename === $path) || (is_dir($path) && $startsWith($testCase->filename, $path))) {\n                foreach ($classOrTraits as $class) {\n                    /** @var string $class */\n                    if (class_exists($class)) {\n                        if ($testCase->class !== TestCase::class) {\n                            throw new TestCaseAlreadyInUse($testCase->class, $class, $testCase->filename);\n                        }\n                        $testCase->class = $class;\n                    } elseif (trait_exists($class)) {\n                        $testCase->traits[] = $class;\n                    }\n                }\n\n                foreach ($testCase->methods as $method) {\n                    foreach ($groups as $group) {\n                        $method->attributes[] = new Attribute(\n                            Group::class,\n                            [$group],\n                        );\n                    }\n                }\n\n                foreach ($testCase->methods as $method) {\n                    $method->groups = [...$groups, ...$method->groups];","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/pestphp/pest/blob/1af74a215c3a89bc7a44fc6f9322e369eaad2423/src/Repositories/TestRepository.php#L146-L182","documentation":"Error \"The test case [%s] may not be used here. The folder [%s] is already bound to the test case [%s].\" thrown in pestphp/pest.","triggerScenarios":"Thrown at src/Repositories/TestRepository.php:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1af74a215c3a89bc7a44fc6f9322e369eaad2423","analyzedAt":"2026-08-21T02:16:38.132Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}