-
Notifications
You must be signed in to change notification settings - Fork 3
fix: seeder generation logic #223
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
Open
artengin
wants to merge
11
commits into
master
Choose a base branch
from
fix-seeder-generation-logic
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
43bde20
fix: seeder generation logic
artengin 2ed9b65
Apply suggestion from @AZabolotnikov
AZabolotnikov 4899ed8
Apply suggestion from @AZabolotnikov
AZabolotnikov 14b2917
Merge branch 'master' into fix-seeder-generation-logic
artengin ddedf65
Merge remote-tracking branch 'origin/master' into fix-seeder-generati…
artengin ad0bb35
Merge branch 'master' into fix-seeder-generation-logic
artengin d84d7db
Merge branch 'master' into fix-seeder-generation-logic
DenTray a8f0bba
fix: remarks from reviewer
artengin 726f930
Merge branch 'master' into fix-seeder-generation-logic
artengin ef8747a
Merge branch 'master' into fix-seeder-generation-logic
DenTray 1aa69c0
fix: remarks from reviewer
artengin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?php | ||
|
|
||
| namespace RonasIT\Support\Tests\Support\Seeder; | ||
|
|
||
| use org\bovigo\vfs\vfsStream; | ||
| use RonasIT\Support\Tests\Support\GeneratorMockTrait; | ||
|
|
||
| trait SeederGeneratorMockTrait | ||
| { | ||
| use GeneratorMockTrait; | ||
|
|
||
| public function mockFilesystem(): void | ||
| { | ||
| $structure = [ | ||
| 'database' => [ | ||
| 'seeders' => [], | ||
| ], | ||
| ]; | ||
|
|
||
| $root = vfsStream::setup('root', null, $structure); | ||
|
|
||
| $databaseSeederContent = file_get_contents(getcwd() . '/tests/fixtures/SeederGeneratorTest/database_seeder_existing.php'); | ||
|
|
||
| vfsStream::newFile('database/seeders/DatabaseSeeder.php') | ||
| ->at($root) | ||
| ->setContent($databaseSeederContent); | ||
| } | ||
| } | ||
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
tests/fixtures/SeederGeneratorTest/database_seeder_existing.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|
|
||
| namespace Database\Seeders; | ||
|
|
||
| use Illuminate\Database\Seeder; | ||
|
|
||
| class DatabaseSeeder extends Seeder | ||
| { | ||
| /** | ||
| * Run the database seeds. | ||
| * | ||
| * @return void | ||
| */ | ||
| public function run() | ||
| { | ||
| $this->call(AuthorSeeder::class); | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
tests/fixtures/SeederGeneratorTest/database_seeder_modified.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?php | ||
|
|
||
| namespace Database\Seeders; | ||
|
|
||
| use Illuminate\Database\Seeder; | ||
|
|
||
| class DatabaseSeeder extends Seeder | ||
| { | ||
| /** | ||
| * Run the database seeds. | ||
| * | ||
| * @return void | ||
| */ | ||
| public function run() | ||
| { | ||
| $this->call(AuthorSeeder::class); | ||
| $this->call(PostSeeder::class); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.