-
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 4 commits
79baddf
c38edcb
6b3eefe
4d704fa
a43a514
16f9a24
32988da
63ca88d
1d3b358
c5a3c41
05ce544
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 |
|---|---|---|
|
|
@@ -186,7 +186,6 @@ protected function getMockModel($model): array | |
| protected function generateFixtures(): void | ||
| { | ||
| $object = $this->getFixtureValuesList($this->model); | ||
| $entity = Str::snake($this->model); | ||
DenTray marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| $this->createFixtureFolder(); | ||
|
|
||
|
|
@@ -195,7 +194,7 @@ protected function generateFixtures(): void | |
| foreach ($modifications as $modification) { | ||
| $excepts = ($modification === 'request') ? ['id'] : []; | ||
|
|
||
| $this->generateFixture("{$type}_{$entity}_{$modification}.json", Arr::except($object, $excepts)); | ||
| $this->generateFixture("{$type}_" . Str::snake($this->getTestingEntityName()) . "_{$modification}.json", Arr::except($object, $excepts)); | ||
|
||
| } | ||
| } | ||
| } | ||
|
|
@@ -259,6 +258,8 @@ abstract protected function isFixtureNeeded($type): bool; | |
|
|
||
| abstract protected function generateTests(): void; | ||
|
|
||
| abstract protected function getTestingEntityName(): string; | ||
|
|
||
| private function filterBadModelField($fields): array | ||
| { | ||
| return array_diff($fields, [ | ||
|
|
||
| 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.