Skip to content

Commit d1cfd0a

Browse files
committed
fix: use relative nova path for check nova resource namespace
1 parent defdc96 commit d1cfd0a

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/Generators/NovaTestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected function getCommonNovaResources(): array
134134

135135
$class = Str::before($relativePath, '.');
136136

137-
$className = $this->pathToNamespace($this->novaPath . DIRECTORY_SEPARATOR . $class);
137+
$className = $this->pathToNamespace($this->paths['nova'] . DIRECTORY_SEPARATOR . $class);
138138

139139
if ($this->isResourceNameContainModel($className) && $this->isNovaResource($className)) {
140140
$resources[] = $className;

tests/Support/Command/CommandMockTrait.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function mockGenerator(): void
5252
$this->nativeClassExistsMethodCall(['RonasIT\Support\Tests\Support\Command\Models\Post', true]),
5353
$this->nativeClassExistsMethodCall(['Laravel\Nova\NovaServiceProvider', true]),
5454
$this->nativeClassExistsMethodCall(['Laravel\Nova\NovaServiceProvider', true]),
55-
$this->nativeUcwordsMethodCall(['vfs:\\\\root\\app\\Nova\\PostResource', '\\'], 'App\Nova\PostResource'),
5655
$this->nativeIsSubClassOfMethodCall(['App\Nova\PostResource', 'Laravel\\Nova\\Resource']),
5756
$this->nativeClassExistsMethodCall(['RonasIT\Support\Tests\Support\Command\Models\Post', true]),
5857
);
@@ -79,7 +78,6 @@ public function mockGeneratorSubFolders(): void
7978
$this->nativeClassExistsMethodCall(['RonasIT\Support\Tests\Support\Command\Models\Forum\Post', true]),
8079
$this->nativeClassExistsMethodCall(['Laravel\Nova\NovaServiceProvider', true]),
8180
$this->nativeClassExistsMethodCall(['Laravel\Nova\NovaServiceProvider', true]),
82-
$this->nativeUcwordsMethodCall(['vfs:\\\\root\\app\\Nova\\Forum\\PostResource', '\\'], 'App\Nova\Forum\PostResource'),
8381
$this->nativeIsSubClassOfMethodCall(['App\Nova\Forum\PostResource', 'Laravel\\Nova\\Resource']),
8482
$this->nativeClassExistsMethodCall(['RonasIT\Support\Tests\Support\Command\Models\Forum\Post', true]),
8583
);
@@ -93,13 +91,4 @@ public function nativeIsSubClassOfMethodCall(array $arguments, bool $result = tr
9391
'result' => $result,
9492
];
9593
}
96-
97-
public function nativeUcwordsMethodCall(array $arguments, string $result): array
98-
{
99-
return [
100-
'function' => 'ucwords',
101-
'arguments' => $arguments,
102-
'result' => $result,
103-
];
104-
}
10594
}

0 commit comments

Comments
 (0)