File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
system/Commands/Generators Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -173,20 +173,17 @@ protected function buildPath(string $class): string
173173 /**
174174 * Returns test file path for the namespace.
175175 */
176- private function searchTestFilePath (string $ namespace ): ?string
176+ private function searchTestFilePath (string $ testNamespace ): ?string
177177 {
178- $ bases = service ('autoloader ' )->getNamespace ($ namespace );
178+ /** @var list<non-empty-string> $testPaths */
179+ $ testPaths = service ('autoloader ' )->getNamespace ($ testNamespace );
179180
180- $ base = null ;
181-
182- foreach ($ bases as $ candidate ) {
183- if (str_contains ($ candidate , '/tests/ ' )) {
184- $ base = $ candidate ;
185-
186- break ;
181+ foreach ($ testPaths as $ candidate ) {
182+ if (str_contains ($ candidate , DIRECTORY_SEPARATOR . 'tests ' . DIRECTORY_SEPARATOR )) {
183+ return $ candidate ;
187184 }
188185 }
189186
190- return $ base ;
187+ return null ;
191188 }
192189}
You can’t perform that action at this time.
0 commit comments