@@ -29,6 +29,7 @@ public function testRunWithoutAdminAndReadmeCreation()
29
29
->expectsQuestion ('Please enter an application URL ' , 'https://mysite.com ' )
30
30
->expectsConfirmation ('Do you want to generate an admin user? ' )
31
31
->expectsConfirmation ('Do you want to generate a README file? ' )
32
+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
32
33
->assertExitCode (0 );
33
34
}
34
35
@@ -64,6 +65,7 @@ public function testRunWithAdminAndWithoutReadmeCreation()
64
65
->expectsQuestion ('Please enter an admin password ' , '123456 ' )
65
66
->expectsQuestion ('Please enter an admin role id ' , 1 )
66
67
->expectsConfirmation ('Do you want to generate a README file? ' )
68
+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
67
69
->assertExitCode (0 );
68
70
}
69
71
@@ -193,6 +195,7 @@ public function testRunWithAdminAndDefaultReadmeCreation()
193
195
->expectsOutput ('- ArgoCD link ' )
194
196
->expectsOutput ('- Manager \'s email ' )
195
197
->expectsOutput ('- Code Owner/Team Lead \'s email ' )
198
+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
196
199
->assertExitCode (0 );
197
200
}
198
201
@@ -295,10 +298,11 @@ public function testRunWithAdminAndPartialReadmeCreation()
295
298
->expectsOutput ('Don`t forget to fill the following empty values: ' )
296
299
->expectsOutput ('- Issue Tracker link ' )
297
300
->expectsOutput ('- Code Owner/Team Lead \'s email ' )
301
+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' )
298
302
->assertExitCode (0 );
299
303
}
300
304
301
- public function testRunWithAdminAndFullReadmeCreation ()
305
+ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializator ()
302
306
{
303
307
$ this ->mockShellExec ();
304
308
@@ -360,6 +364,14 @@ public function testRunWithAdminAndFullReadmeCreation()
360
364
]
361
365
);
362
366
367
+ $ this ->mockNativeFunction ('RonasIT\ProjectInitializator\Commands ' , [
368
+ $ this ->functionCall ('exec ' , [
369
+ 'cd /app/tests/.. && composer remove ronasit/laravel-project-initializator ' ,
370
+ 'optionalParameter ' ,
371
+ 'optionalParameter ' ,
372
+ ], 'success ' ),
373
+ ]);
374
+
363
375
$ this
364
376
->artisan ('init "My App" ' )
365
377
->expectsOutput ('Project initialized successfully! ' )
@@ -418,6 +430,7 @@ public function testRunWithAdminAndFullReadmeCreation()
418
430
->
expectsQuestion (
'Please enter a Laravel Nova \'s admin email ' ,
'[email protected] ' )
419
431
->expectsQuestion ('Please enter a Laravel Nova \'s admin password ' , '654321 ' )
420
432
->expectsOutput ('README generated successfully! ' )
433
+ ->expectsConfirmation ('Do you want to uninstall project-initializator package? ' , 'yes ' )
421
434
->assertExitCode (0 );
422
435
}
423
436
}
0 commit comments