File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,6 @@ class InitCommand extends Command implements Isolatable
6060 'composer require ronasit/laravel-helpers ' ,
6161 'composer require ronasit/laravel-swagger ' ,
6262 'composer require --dev ronasit/laravel-entity-generator ' ,
63- 'composer require ronasit/laravel-telescope-extension ' ,
64- 'php artisan telescope:install ' ,
6563 ];
6664
6765 protected string $ appName ;
@@ -141,6 +139,11 @@ public function handle(): void
141139 }
142140 }
143141
142+ if (!class_exists (\Laravel \Telescope \TelescopeServiceProvider::class)) {
143+ $ this ->shellCommands [] = 'composer require ronasit/laravel-telescope-extension ' ;
144+ $ this ->shellCommands [] = 'php artisan telescope:install ' ;
145+ }
146+
144147 if ($ this ->confirm ('Do you want to install media package? ' )) {
145148 $ this ->shellCommands [] = 'composer require ronasit/laravel-media ' ;
146149 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function testRunWithoutAdminAndReadmeCreation()
5353 ->assertExitCode (0 );
5454 }
5555
56- public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCase ()
56+ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTelescopeAlreadyInstalled ()
5757 {
5858 $ this ->mockFileGetContent (
5959 [
@@ -71,12 +71,19 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCase()
7171 'env.development_app_name_pascal_case.yml ' ,
7272 );
7373
74+ $ this ->mockNativeFunction ('RonasIT\ProjectInitializator\Commands ' ,
75+ callChain: [
76+ $ this ->functionCall (
77+ name: 'class_exists ' ,
78+ arguments: ['Laravel\Telescope\TelescopeServiceProvider ' , true ],
79+ ),
80+ ],
81+ );
82+
7483 $ this ->mockShellExec (
7584 ['arguments ' => 'composer require ronasit/laravel-helpers --ansi ' ],
7685 ['arguments ' => 'composer require ronasit/laravel-swagger --ansi ' ],
7786 ['arguments ' => 'composer require --dev ronasit/laravel-entity-generator --ansi ' ],
78- ['arguments ' => 'composer require ronasit/laravel-telescope-extension --ansi ' ],
79- ['arguments ' => 'php artisan telescope:install --ansi ' ],
8087 );
8188
8289 $ this
You can’t perform that action at this time.
0 commit comments