File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public function generate(): void
1212 if (!$ this ->classExists ('models ' , $ this ->model )) {
1313 $ this ->throwFailureException (
1414 ClassNotExistsException::class,
15- "Cannot create {$ this ->model } Model cause {$ this ->model } Model does not exists. " ,
15+ "Cannot create {$ this ->model }Repository cause {$ this ->model } Model does not exists. " ,
1616 "Create a {$ this ->model } Model by himself or run command 'php artisan make:entity {$ this ->model } --only-model'. "
1717 );
1818 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public function testModelNotExist()
2020
2121 $ this ->assertExceptionThrew (
2222 className: ClassNotExistsException::class,
23- message: "Cannot create Post Model cause Post Model does not exists. "
23+ message: "Cannot create PostRepository cause Post Model does not exists. "
2424 . "Create a Post Model by himself or run command 'php artisan make:entity Post --only-model'. " ,
2525 );
2626
Original file line number Diff line number Diff line change 22
33namespace RonasIT \Support \Tests \Support \Repository ;
44
5- use org \ bovigo \ vfs \ vfsStream ;
5+ use RonasIT \ Support \ Tests \ Support \ FileSystemMock ;
66use RonasIT \Support \Tests \Support \GeneratorMockTrait ;
7- use RonasIT \Support \Traits \MockTrait ;
87
98trait RepositoryMockTrait
109{
11- use GeneratorMockTrait, MockTrait ;
10+ use GeneratorMockTrait;
1211
1312 public function mockFilesystem (): void
1413 {
15- $ structure = [
16- 'app ' => [
17- 'Models ' => [
18- 'Post.php ' => '<?php ' ,
19- ],
20- 'Repositories ' => [],
21- ],
14+ $ fileSystemMock = new FileSystemMock ;
15+
16+ $ fileSystemMock ->models = [
17+ 'Post.php ' => $ this ->mockPhpFileContent (),
2218 ];
2319
24- vfsStream:: create ( $ structure );
20+ $ fileSystemMock -> setStructure ( );
2521 }
2622}
You can’t perform that action at this time.
0 commit comments