-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: set resource name in dump/fixtures #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
79baddf
c38edcb
6b3eefe
4d704fa
a43a514
16f9a24
32988da
63ca88d
1d3b358
c5a3c41
05ce544
103369d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,13 +21,6 @@ class NovaTestGenerator extends AbstractTestsGenerator | |||||
| public function generate(): void | ||||||
| { | ||||||
| if (class_exists(NovaServiceProvider::class)) { | ||||||
| if ($this->classExists('nova', "Nova{$this->model}ResourceTest")) { | ||||||
|
|
||||||
| $path = $this->getClassPath('nova', "Nova{$this->model}ResourceTest"); | ||||||
|
|
||||||
| throw new ResourceAlreadyExistsException($path); | ||||||
| } | ||||||
|
|
||||||
| $novaResources = $this->getCommonNovaResources(); | ||||||
|
|
||||||
| if (count($novaResources) > 1) { | ||||||
|
|
@@ -51,6 +44,14 @@ public function generate(): void | |||||
|
|
||||||
| $this->novaResourceClassName = Arr::first($novaResources); | ||||||
|
|
||||||
| $entityName = $this->getTestingEntityName(); | ||||||
|
|
||||||
|
||||||
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ($this->classExists('nova', "Nova{$entityName}Test")) { | |
| if ($this->classExists('nova', $this->getTestClassName())) { |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $path = $this->getClassPath('nova', "Nova{$entityName}Test"); | |
| $path = $this->getClassPath('nova', $this->getTestClassName()); |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reasons to make it after searching the nova resource in the filesystem???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic of the abstract method getTestingEntityName depends on the filesystem scan
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -68,6 +68,9 @@ public function testGenerateNovaTestAlreadyExists() | |||||
|
|
||||||
| $this->mockClass(NovaTestGenerator::class, [ | ||||||
| $this->classExistsMethodCall(['nova', 'NovaPostResourceTest']), | ||||||
| $this->getCommonNovaResourcesMock([ | ||||||
| 'PostResource', | ||||||
| ]), | ||||||
| ]); | ||||||
|
|
||||||
| $this->assertExceptionThrew( | ||||||
|
|
@@ -107,10 +110,10 @@ public function testNovaTestStubNotExist() | |||||
| ->generate(); | ||||||
|
|
||||||
| $this->assertFileDoesNotExist('tests/NovaWelcomeBonusTest.php'); | ||||||
|
||||||
| $this->assertFileDoesNotExist('tests/NovaWelcomeBonusTest.php'); | |
| $this->assertFileDoesNotExist('tests/NovaWelcomeBonusResourceTest.php'); |
Uh oh!
There was an error while loading. Please reload this page.