Skip to content

Commit 371e3ff

Browse files
Changing getcwd() to base_path() (#8)
* Changing getcwd() to base_path() * eh --------- Co-authored-by: William Hall <[email protected]>
1 parent b52059f commit 371e3ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Http/Controllers/EnumController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public function __invoke(): Response|JsonResponse
3636
->reject(fn ($i) => $i->isDir() || str_ends_with($i->getRealPath(), '/..'))
3737
->map(function ($item) {
3838
// Build the class name from the file path.
39-
$path = ucfirst(str_replace(getcwd() . '/', '', $item->getRealPath()));
39+
$cwd = (app()->runningUnitTests()) ? getcwd() : base_path();
40+
41+
$path = ucfirst(str_replace($cwd . '/', '', $item->getRealPath()));
4042
return rtrim(str_replace(DIRECTORY_SEPARATOR, '\\', $path), '.php');
4143
})
4244
->filter(function ($i) {

0 commit comments

Comments
 (0)