22
33namespace RonasIT \Support \Tests \Support \NovaTestGeneratorTest ;
44
5- use RonasIT \ Support \ Generators \ NovaTestGenerator ;
5+ use Mockery ;
66use RonasIT \Support \Tests \Support \FileSystemMock ;
77use RonasIT \Support \Tests \Support \GeneratorMockTrait ;
88use RonasIT \Support \Traits \MockTrait ;
@@ -14,42 +14,9 @@ trait NovaTestGeneratorMockTrait
1414
1515 public function mockNovaResourceTestGenerator (): void
1616 {
17- $ this ->mockClass (NovaTestGenerator::class, [
18- [
19- 'function ' => 'getMockModel ' ,
20- 'arguments ' => ['WelcomeBonus ' ],
21- 'result ' => ['title ' => 'some title ' , 'name ' => 'some name ' ]
22- ],
23- [
24- 'function ' => 'getMockModel ' ,
25- 'arguments ' => ['WelcomeBonus ' ],
26- 'result ' => ['title ' => 'some title ' , 'name ' => 'some name ' ]
27- ],
28- [
29- 'function ' => 'loadNovaActions ' ,
30- 'arguments ' => [],
31- 'result ' => [
32- new PublishPostAction ,
33- new UnPublishPostAction ,
34- new UnPublishPostAction ,
35- ]
36- ],
37- [
38- 'function ' => 'loadNovaFields ' ,
39- 'arguments ' => [],
40- 'result ' => [
41- new TextField ,
42- new DateField ,
43- ]
44- ],
45- [
46- 'function ' => 'loadNovaFilters ' ,
47- 'arguments ' => [],
48- 'result ' => [
49- new CreatedAtFilter ,
50- ]
51- ],
52- ]);
17+ $ mock = Mockery::mock ('alias:Laravel\Nova\Http\Requests\NovaRequest ' );
18+
19+ $ this ->app ->instance ('Laravel\Nova\Http\Requests\NovaRequest ' , $ mock );
5320 }
5421
5522 public function mockFilesystem (): void
@@ -64,7 +31,7 @@ public function mockFilesystem(): void
6431 ];
6532
6633 $ fileSystemMock ->novaModels = [
67- 'WelcomeBonus .php ' => $ this ->mockPhpFileContent (),
34+ 'WelcomeBonusResource .php ' => $ this ->mockPhpFileContent (),
6835 ];
6936
7037 $ fileSystemMock ->models = [
0 commit comments