File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ public function install(Event $event)
407
407
}
408
408
409
409
// Execute missing recipes
410
- $ recipes = $ this ->fetchRecipes ($ this ->operations );
410
+ $ recipes = ScriptEvents:: POST_UPDATE_CMD === $ event -> getName () ? $ this ->fetchRecipes ($ this ->operations ) : [] ;
411
411
$ this ->operations = []; // Reset the operation after getting recipes
412
412
413
413
if (2 === $ this ->displayThanksReminder ) {
@@ -422,10 +422,10 @@ public function install(Event $event)
422
422
$ this ->io ->writeError ('' );
423
423
424
424
if (!$ recipes ) {
425
- if (null !== $ event && ScriptEvents::POST_UPDATE_CMD === $ event ->getName ()) {
425
+ if (ScriptEvents::POST_UPDATE_CMD === $ event ->getName ()) {
426
426
$ this ->synchronizePackageJson ($ rootDir );
427
+ $ this ->lock ->write ();
427
428
}
428
- $ this ->lock ->write ();
429
429
430
430
if ($ this ->downloader ->isEnabled ()) {
431
431
$ this ->io ->writeError ('Run <comment>composer recipes</> at any time to see the status of your Symfony recipes. ' );
Original file line number Diff line number Diff line change 25
25
use Composer \Repository \RepositoryManager ;
26
26
use Composer \Repository \WritableRepositoryInterface ;
27
27
use Composer \Script \Event ;
28
+ use Composer \Script \ScriptEvents ;
28
29
use Composer \Semver \Constraint \MatchAllConstraint ;
29
30
use PHPUnit \Framework \TestCase ;
30
31
use Symfony \Component \Console \Output \OutputInterface ;
@@ -306,7 +307,10 @@ private function mockLock(): Lock
306
307
307
308
private function mockFlexEvent (): Event
308
309
{
309
- return $ this ->getMockBuilder (Event::class)->disableOriginalConstructor ()->getMock ();
310
+ $ event = $ this ->getMockBuilder (Event::class)->disableOriginalConstructor ()->getMock ();
311
+ $ event ->expects ($ this ->any ())->method ('getName ' )->willReturn (ScriptEvents::POST_UPDATE_CMD );
312
+
313
+ return $ event ;
310
314
}
311
315
312
316
private function mockManager (): RepositoryManager
You can’t perform that action at this time.
0 commit comments