22
33namespace RonasIT \ProjectInitializator \Tests ;
44
5- use Illuminate \Support \Facades \File ;
65use RonasIT \ProjectInitializator \Tests \Support \Traits \InitCommandMockTrait ;
76
87class InitCommandTest extends TestCase
@@ -51,6 +50,8 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
5150 $ this ->callShellExec ('composer require --dev brainmaestro/composer-git-hooks --ansi ' ),
5251 $ this ->callShellExec ('./vendor/bin/cghooks update --ansi ' ),
5352 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
53+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
54+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
5455 );
5556
5657 $ this
@@ -67,8 +68,6 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
6768 ->expectsConfirmation ('Do you want to install media package? ' )
6869 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
6970 ->assertExitCode (0 );
70-
71- $ this ->assertWebLoginPublished ();
7271 }
7372
7473 public function testRunWithoutAdminAndReadmeCreation ()
@@ -112,6 +111,8 @@ public function testRunWithoutAdminAndReadmeCreation()
112111 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
113112 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
114113 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
114+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
115+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
115116 );
116117
117118 $ this
@@ -128,8 +129,6 @@ public function testRunWithoutAdminAndReadmeCreation()
128129 ->expectsConfirmation ('Do you want to install media package? ' )
129130 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
130131 ->assertExitCode (0 );
131-
132- $ this ->assertWebLoginPublished ();
133132 }
134133
135134 public function testRunWithAdminAndWithoutReadmeCreation ()
@@ -173,6 +172,8 @@ public function testRunWithAdminAndWithoutReadmeCreation()
173172 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
174173 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
175174 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
175+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
176+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
176177 );
177178
178179 $ this
@@ -193,8 +194,6 @@ public function testRunWithAdminAndWithoutReadmeCreation()
193194 ->expectsConfirmation ('Do you want to install media package? ' )
194195 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
195196 ->assertExitCode (0 );
196-
197- $ this ->assertWebLoginPublished ();
198197 }
199198
200199 public function testRunWithAdminAndDefaultReadmeCreation ()
@@ -258,6 +257,8 @@ public function testRunWithAdminAndDefaultReadmeCreation()
258257 $ this ->callShellExec ('php artisan laravel-clerk:install --ansi ' ),
259258 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
260259 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
260+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
261+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
261262 );
262263
263264 $ this
@@ -328,8 +329,6 @@ public function testRunWithAdminAndDefaultReadmeCreation()
328329 ->expectsConfirmation ('Do you want to install media package? ' )
329330 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
330331 ->assertExitCode (0 );
331-
332- $ this ->assertWebLoginPublished ();
333332 }
334333
335334 public function testRunWithAdminAndPartialReadmeCreation ()
@@ -379,6 +378,8 @@ public function testRunWithAdminAndPartialReadmeCreation()
379378 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
380379 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
381380 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
381+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
382+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
382383 );
383384
384385 $ this
@@ -439,8 +440,6 @@ public function testRunWithAdminAndPartialReadmeCreation()
439440 ->expectsConfirmation ('Do you want to install media package? ' )
440441 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
441442 ->assertExitCode (0 );
442-
443- $ this ->assertWebLoginPublished ();
444443 }
445444
446445 public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorInstallationMedia ()
@@ -498,7 +497,9 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
498497 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
499498 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
500499 $ this ->callShellExec ('composer require ronasit/laravel-media --ansi ' ),
501- $ this ->callShellExec ('composer remove --dev ronasit/laravel-project-initializator --no-script --ansi ' ),
500+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
501+ $ this ->callShellExec ('composer remove --dev ronasit/laravel-project-initializator --ansi ' ),
502+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
502503 );
503504
504505 $ this
@@ -566,8 +567,6 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
566567 ->expectsConfirmation ('Do you want to install media package? ' , 'yes ' )
567568 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' , 'yes ' )
568569 ->assertExitCode (0 );
569-
570- $ this ->assertWebLoginPublished ();
571570 }
572571
573572 public function testRunWithoutAdminAndUsingTelescope ()
@@ -617,6 +616,8 @@ public function testRunWithoutAdminAndUsingTelescope()
617616 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
618617 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
619618 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
619+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
620+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
620621 );
621622
622623 $ this
@@ -681,8 +682,6 @@ public function testRunWithoutAdminAndUsingTelescope()
681682 ->expectsConfirmation ('Do you want to install media package? ' )
682683 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
683684 ->assertExitCode (0 );
684-
685- $ this ->assertWebLoginPublished ();
686685 }
687686
688687 public function testRunWithClerkMobileAppWithPintInstalled (): void
@@ -746,6 +745,8 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
746745 $ this ->callShellExec ('php artisan laravel-clerk:install --ansi ' ),
747746 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
748747 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
748+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
749+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
749750 );
750751
751752 $ this
@@ -816,21 +817,5 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
816817 ->expectsConfirmation ('Do you want to install media package? ' )
817818 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
818819 ->assertExitCode (0 );
819-
820- $ this ->assertWebLoginPublished ();
821- }
822-
823- protected function assertWebLoginPublished (): void
824- {
825- $ this ->assertFileEqualsFixture ('login_controller.php ' , app_path ('Http/Controllers/Auth/LoginController.php ' ));
826- $ this ->assertFileEqualsFixture ('app.css ' , public_path ('app.css ' ));
827- $ this ->assertFileEqualsFixture ('app.js ' , public_path ('app.js ' ));
828- $ this ->assertFileEqualsFixture ('app.blade.php ' , resource_path ('views/layouts/app.blade.php ' ));
829- $ this ->assertFileEqualsFixture ('login.blade.php ' , resource_path ('views/auth/login.blade.php ' ));
830-
831- File::deleteDirectory (app_path ());
832- File::deleteDirectory (public_path ());
833- File::deleteDirectory (resource_path ('views/layouts ' ));
834- File::deleteDirectory (resource_path ('views/auth ' ));
835820 }
836821}
0 commit comments