@@ -33,6 +33,45 @@ public function testRunWithoutAdminAndReadmeCreation()
3333
3434 $ this
3535 ->artisan ('init "My App" ' )
36+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' )
37+ ->expectsOutput ('Project initialized successfully! ' )
38+ ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
39+ ->expectsConfirmation ('Do you want to generate an admin user? ' )
40+ ->expectsConfirmation ('Do you want to generate a README file? ' )
41+ ->expectsConfirmation ('Do you want to install media package? ' )
42+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
43+ ->assertExitCode (0 );
44+ }
45+
46+ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCase ()
47+ {
48+ $ this ->mockFileGetContent (
49+ [
50+ 'arguments ' => ['.env.example ' ],
51+ 'result ' => $ this ->getFixture ('env.example_app_name_pascal_case.yml ' ),
52+ ],
53+ [
54+ 'arguments ' => ['.env.development ' ],
55+ 'result ' => $ this ->getFixture ('env.development_app_name_pascal_case.yml ' ),
56+ ],
57+ );
58+
59+ $ this ->mockFilePutContent (
60+ 'env.example_app_name_pascal_case.yml ' ,
61+ 'env.development_app_name_pascal_case.yml ' ,
62+ );
63+
64+ $ this ->mockShellExec (
65+ ['arguments ' => 'composer require ronasit/laravel-helpers --ansi ' ],
66+ ['arguments ' => 'composer require ronasit/laravel-swagger --ansi ' ],
67+ ['arguments ' => 'composer require --dev ronasit/laravel-entity-generator --ansi ' ],
68+ ['arguments ' => 'composer require laravel/telescope --ansi ' ],
69+ ['arguments ' => 'php artisan telescope:install --ansi ' ],
70+ );
71+
72+ $ this
73+ ->artisan ('init "My App" ' )
74+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' , 'yes ' )
3675 ->expectsOutput ('Project initialized successfully! ' )
3776 ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
3877 ->expectsConfirmation ('Do you want to generate an admin user? ' )
@@ -56,12 +95,14 @@ public function testRunWithAdminAndWithoutReadmeCreation()
5695 );
5796
5897 $ this ->mockFilePutContent (
98+ 'env.example.yml ' ,
99+ 'env.development.yml ' ,
59100 [
60101 'database/migrations/2018_11_11_111111_add_default_user.php ' ,
61102 $ this ->getFixture ('migration.php ' ),
62103 'optionalParameter ' ,
63104 'optionalParameter ' ,
64- ]
105+ ],
65106 );
66107
67108 $ this ->mockShellExec (
@@ -74,6 +115,7 @@ public function testRunWithAdminAndWithoutReadmeCreation()
74115
75116 $ this
76117 ->artisan ('init "My App" ' )
118+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' )
77119 ->expectsOutput ('Project initialized successfully! ' )
78120 ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
79121 ->expectsConfirmation ('Do you want to generate an admin user? ' , 'yes ' )
@@ -133,6 +175,8 @@ public function testRunWithAdminAndDefaultReadmeCreation()
133175 );
134176
135177 $ this ->mockFilePutContent (
178+ 'env.example.yml ' ,
179+ 'env.development.yml ' ,
136180 [
137181 'database/migrations/2018_11_11_111111_add_default_user.php ' ,
138182 $ this ->getFixture ('migration.php ' ),
@@ -158,6 +202,7 @@ public function testRunWithAdminAndDefaultReadmeCreation()
158202
159203 $ this
160204 ->artisan ('init "My App" ' )
205+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' )
161206 ->expectsOutput ('Project initialized successfully! ' )
162207 ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
163208 ->expectsConfirmation ('Do you want to generate an admin user? ' , 'yes ' )
@@ -263,6 +308,8 @@ public function testRunWithAdminAndPartialReadmeCreation()
263308 );
264309
265310 $ this ->mockFilePutContent (
311+ 'env.example.yml ' ,
312+ 'env.development.yml ' ,
266313 [
267314 'README.md ' ,
268315 $ this ->getFixture ('partial_readme.md ' ),
@@ -281,6 +328,7 @@ public function testRunWithAdminAndPartialReadmeCreation()
281328
282329 $ this
283330 ->artisan ('init "My App" ' )
331+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' )
284332 ->expectsOutput ('Project initialized successfully! ' )
285333 ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
286334 ->expectsConfirmation ('Do you want to generate an admin user? ' )
@@ -383,6 +431,8 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
383431 );
384432
385433 $ this ->mockFilePutContent (
434+ 'env.example.yml ' ,
435+ 'env.development.yml ' ,
386436 [
387437 'database/migrations/2018_11_11_111111_add_default_user.php ' ,
388438 $ this ->getFixture ('migration.php ' ),
@@ -410,6 +460,7 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
410460
411461 $ this
412462 ->artisan ('init "My App" ' )
463+ ->expectsConfirmation ('The application name is not in PascalCase, would you like to use MyApp ' )
413464 ->expectsOutput ('Project initialized successfully! ' )
414465 ->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
415466 ->expectsConfirmation ('Do you want to generate an admin user? ' , 'yes ' )
0 commit comments