File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 33namespace RonasIT \Support \Tests ;
44
55use Carbon \Carbon ;
6+ use Illuminate \Support \Facades \Config ;
7+ use org \bovigo \vfs \vfsStream ;
68use RonasIT \Support \Exceptions \ClassNotExistsException ;
79use RonasIT \Support \Tests \Support \Command \CommandMockTrait ;
810use UnexpectedValueException ;
@@ -113,4 +115,32 @@ public function testMakeOnly()
113115 $ this ->assertFileDoesNotExist ('tests/fixtures/NovaPostTest/create_post_response.json ' );
114116 $ this ->assertFileDoesNotExist ('tests/fixtures/NovaPostTest/update_post_request.json ' );
115117 }
118+
119+ public function testCallWithNotDefaultConfig ()
120+ {
121+ $ rootUrl = vfsStream::setup ('root ' , null , [
122+ 'config ' => [
123+ 'entity-generator.php ' => "<?php return ['test' => 'original']; " ,
124+ ],
125+ 'routes ' => [
126+ 'api.php ' => "" ,
127+ ],
128+ ])->url ();
129+
130+ $ this ->app ->instance ('path.base ' , $ rootUrl );
131+
132+ Config::set ('entity-generator ' , ['test ' => 'changed ' ]);
133+
134+ $ this ->artisan ('make:entity Post ' )
135+ ->expectsOutput ('Config has been updated ' )
136+ ->assertExitCode (0 );
137+
138+ $ configPath = $ rootUrl . '/config/entity-generator.php ' ;
139+
140+ $ updated = include $ configPath ;
141+
142+ $ this ->assertTrue (file_exists ($ configPath ));
143+
144+ $ this ->assertEquals (array_merge (['test ' => 'changed ' ], config ('entity-generator ' )), $ updated );
145+ }
116146}
You can’t perform that action at this time.
0 commit comments