22
33namespace RonasIT \ProjectInitializator \Tests ;
44
5- use Illuminate \Support \Facades \File ;
65use RonasIT \ProjectInitializator \Tests \Support \Traits \InitCommandMockTrait ;
76
87class InitCommandTest extends TestCase
@@ -42,6 +41,8 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
4241 $ this ->callShellExec ('composer require --dev brainmaestro/composer-git-hooks --ansi ' ),
4342 $ this ->callShellExec ('./vendor/bin/cghooks update --ansi ' ),
4443 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
44+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
45+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
4546 );
4647
4748 $ this
@@ -58,8 +59,6 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
5859 ->expectsConfirmation ('Do you want to install media package? ' )
5960 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
6061 ->assertExitCode (0 );
61-
62- $ this ->assertWebLoginPublished ();
6362 }
6463
6564 public function testRunWithoutAdminAndReadmeCreation ()
@@ -94,6 +93,8 @@ public function testRunWithoutAdminAndReadmeCreation()
9493 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
9594 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
9695 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
96+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
97+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
9798 );
9899
99100 $ this
@@ -110,8 +111,6 @@ public function testRunWithoutAdminAndReadmeCreation()
110111 ->expectsConfirmation ('Do you want to install media package? ' )
111112 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
112113 ->assertExitCode (0 );
113-
114- $ this ->assertWebLoginPublished ();
115114 }
116115
117116 public function testRunWithAdminAndWithoutReadmeCreation ()
@@ -146,6 +145,8 @@ public function testRunWithAdminAndWithoutReadmeCreation()
146145 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
147146 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
148147 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
148+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
149+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
149150 );
150151
151152 $ this
@@ -166,8 +167,6 @@ public function testRunWithAdminAndWithoutReadmeCreation()
166167 ->expectsConfirmation ('Do you want to install media package? ' )
167168 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
168169 ->assertExitCode (0 );
169-
170- $ this ->assertWebLoginPublished ();
171170 }
172171
173172 public function testRunWithAdminAndDefaultReadmeCreation ()
@@ -222,6 +221,8 @@ public function testRunWithAdminAndDefaultReadmeCreation()
222221 $ this ->callShellExec ('php artisan laravel-clerk:install --ansi ' ),
223222 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
224223 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
224+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
225+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
225226 );
226227
227228 $ this
@@ -292,8 +293,6 @@ public function testRunWithAdminAndDefaultReadmeCreation()
292293 ->expectsConfirmation ('Do you want to install media package? ' )
293294 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
294295 ->assertExitCode (0 );
295-
296- $ this ->assertWebLoginPublished ();
297296 }
298297
299298 public function testRunWithAdminAndPartialReadmeCreation ()
@@ -334,6 +333,8 @@ public function testRunWithAdminAndPartialReadmeCreation()
334333 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
335334 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
336335 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
336+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
337+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
337338 );
338339
339340 $ this
@@ -394,8 +395,6 @@ public function testRunWithAdminAndPartialReadmeCreation()
394395 ->expectsConfirmation ('Do you want to install media package? ' )
395396 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
396397 ->assertExitCode (0 );
397-
398- $ this ->assertWebLoginPublished ();
399398 }
400399
401400 public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorInstallationMedia ()
@@ -444,7 +443,9 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
444443 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
445444 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
446445 $ this ->callShellExec ('composer require ronasit/laravel-media --ansi ' ),
447- $ this ->callShellExec ('composer remove --dev ronasit/laravel-project-initializator --no-script --ansi ' ),
446+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
447+ $ this ->callShellExec ('composer remove --dev ronasit/laravel-project-initializator --ansi ' ),
448+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
448449 );
449450
450451 $ this
@@ -512,8 +513,6 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
512513 ->expectsConfirmation ('Do you want to install media package? ' , 'yes ' )
513514 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' , 'yes ' )
514515 ->assertExitCode (0 );
515-
516- $ this ->assertWebLoginPublished ();
517516 }
518517
519518 public function testRunWithoutAdminAndUsingTelescope ()
@@ -554,6 +553,8 @@ public function testRunWithoutAdminAndUsingTelescope()
554553 $ this ->callShellExec ('php artisan lang:publish --ansi ' ),
555554 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
556555 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
556+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
557+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
557558 );
558559
559560 $ this
@@ -618,8 +619,6 @@ public function testRunWithoutAdminAndUsingTelescope()
618619 ->expectsConfirmation ('Do you want to install media package? ' )
619620 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
620621 ->assertExitCode (0 );
621-
622- $ this ->assertWebLoginPublished ();
623622 }
624623
625624 public function testRunWithClerkMobileAppWithPintInstalled (): void
@@ -674,6 +673,8 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
674673 $ this ->callShellExec ('php artisan laravel-clerk:install --ansi ' ),
675674 $ this ->callShellExec ('composer require ronasit/laravel-telescope-extension --ansi ' ),
676675 $ this ->callShellExec ('php artisan telescope:install --ansi ' ),
676+ $ this ->callShellExec ('php artisan vendor:publish --tag=initializator-web-login --force ' ),
677+ $ this ->callShellExec ('php artisan migrate --ansi ' ),
677678 );
678679
679680 $ this
@@ -744,21 +745,5 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
744745 ->expectsConfirmation ('Do you want to install media package? ' )
745746 ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
746747 ->assertExitCode (0 );
747-
748- $ this ->assertWebLoginPublished ();
749- }
750-
751- protected function assertWebLoginPublished (): void
752- {
753- $ this ->assertFileEqualsFixture ('login_controller.php ' , app_path ('Http/Controllers/Auth/LoginController.php ' ));
754- $ this ->assertFileEqualsFixture ('app.css ' , public_path ('app.css ' ));
755- $ this ->assertFileEqualsFixture ('app.js ' , public_path ('app.js ' ));
756- $ this ->assertFileEqualsFixture ('app.blade.php ' , resource_path ('views/layouts/app.blade.php ' ));
757- $ this ->assertFileEqualsFixture ('login.blade.php ' , resource_path ('views/auth/login.blade.php ' ));
758-
759- File::deleteDirectory (app_path ());
760- File::deleteDirectory (public_path ());
761- File::deleteDirectory (resource_path ('views/layouts ' ));
762- File::deleteDirectory (resource_path ('views/auth ' ));
763748 }
764749}
0 commit comments