@@ -310,6 +310,47 @@ class_exists(LockArrayRepository::class) ? LockArrayRepository::class : Reposito
310
310
$ this ->assertSame ('2.3 ' , $ recipes ['doctrine/doctrine-bundle ' ]->getVersion ());
311
311
}
312
312
313
+ public function testInstallWithPackageJsonToSynchronizeSkipped ()
314
+ {
315
+ $ io = new BufferIO ('' , OutputInterface::VERBOSITY_VERBOSE );
316
+ $ rootPackage = $ this ->mockRootPackage ([
317
+ 'symfony/flex ' => ['synchronize_package_json ' => false ],
318
+ ]);
319
+
320
+ $ flex = $ this ->mockFlex ($ io , $ rootPackage );
321
+ $ flex ->install ($ this ->mockFlexEvent ());
322
+
323
+ $ this ->assertStringContainsString (
324
+ 'Skip synchronizing package.json with PHP packages ' ,
325
+ $ io ->getOutput (),
326
+ );
327
+ }
328
+
329
+ /**
330
+ * @dataProvider getDataForTestInstallWithoutPackageJsonToSynchronizeSkipped
331
+ */
332
+ public function testInstallWithoutPackageJsonToSynchronizeSkipped (array $ extra )
333
+ {
334
+ $ io = new BufferIO ('' , OutputInterface::VERBOSITY_VERBOSE );
335
+ $ rootPackage = $ this ->mockRootPackage ($ extra );
336
+
337
+ $ flex = $ this ->mockFlex ($ io , $ rootPackage );
338
+ $ flex ->install ($ this ->mockFlexEvent ());
339
+
340
+ $ this ->assertStringNotContainsString (
341
+ 'Skip synchronizing package.json with PHP packages ' ,
342
+ $ io ->getOutput (),
343
+ );
344
+ }
345
+
346
+ public function getDataForTestInstallWithoutPackageJsonToSynchronizeSkipped (): array
347
+ {
348
+ return [
349
+ 'default_behavior ' => [[]],
350
+ 'with_config_explicitly_set ' => [['symfony/flex ' => ['synchronize_package_json ' => true ]]],
351
+ ];
352
+ }
353
+
313
354
public static function getTestPackages (): array
314
355
{
315
356
return [
0 commit comments