@@ -57,7 +57,7 @@ public function testConfigure()
57
57
services:
58
58
59
59
EOF
60
- , file_get_contents ($ config ));
60
+ , file_get_contents ($ config ));
61
61
62
62
$ configurator ->unconfigure ($ recipe , ['locale ' => 'en ' ], $ lock );
63
63
$ this ->assertEquals (<<<EOF
@@ -67,7 +67,7 @@ public function testConfigure()
67
67
services:
68
68
69
69
EOF
70
- , file_get_contents ($ config ));
70
+ , file_get_contents ($ config ));
71
71
}
72
72
73
73
public function testConfigureWithoutParametersKey ()
@@ -95,7 +95,7 @@ public function testConfigureWithoutParametersKey()
95
95
services:
96
96
97
97
EOF
98
- , file_get_contents ($ config ));
98
+ , file_get_contents ($ config ));
99
99
100
100
$ configurator ->unconfigure ($ recipe , ['locale ' => 'en ' ], $ lock );
101
101
$ this ->assertEquals (<<<EOF
@@ -104,7 +104,7 @@ public function testConfigureWithoutParametersKey()
104
104
services:
105
105
106
106
EOF
107
- , file_get_contents ($ config ));
107
+ , file_get_contents ($ config ));
108
108
}
109
109
110
110
public function testConfigureWithoutDuplicated ()
@@ -135,7 +135,7 @@ public function testConfigureWithoutDuplicated()
135
135
services:
136
136
137
137
EOF
138
- , file_get_contents ($ config ));
138
+ , file_get_contents ($ config ));
139
139
140
140
$ configurator ->unconfigure ($ recipe , ['locale ' => 'en ' ], $ lock );
141
141
$ this ->assertEquals (<<<EOF
@@ -144,7 +144,7 @@ public function testConfigureWithoutDuplicated()
144
144
services:
145
145
146
146
EOF
147
- , file_get_contents ($ config ));
147
+ , file_get_contents ($ config ));
148
148
}
149
149
150
150
public function testConfigureWithComplexContent ()
@@ -184,7 +184,7 @@ public function testConfigureWithComplexContent()
184
184
services:
185
185
186
186
EOF
187
- , file_get_contents ($ config ));
187
+ , file_get_contents ($ config ));
188
188
189
189
$ configurator ->unconfigure ($ recipe , ['locale ' => 'en ' , 'foobar ' => 'baz ' ], $ lock );
190
190
$ this ->assertEquals (<<<EOF
@@ -197,7 +197,7 @@ public function testConfigureWithComplexContent()
197
197
services:
198
198
199
199
EOF
200
- , file_get_contents ($ config ));
200
+ , file_get_contents ($ config ));
201
201
}
202
202
203
203
public function testConfigureWithComplexContent2 ()
@@ -356,6 +356,60 @@ public function testUpdate()
356
356
357
357
services:
358
358
359
+ EOF
360
+ ], $ recipeUpdate ->getNewFiles ());
361
+ }
362
+
363
+ public function testUpdateWithNoRemovedKeysInUpdate ()
364
+ {
365
+ $ configurator = new ContainerConfigurator (
366
+ $ this ->createMock (Composer::class),
367
+ $ this ->createMock (IOInterface::class),
368
+ new Options (['config-dir ' => 'config ' , 'root-dir ' => FLEX_TEST_DIR ])
369
+ );
370
+
371
+ $ recipeUpdate = new RecipeUpdate (
372
+ $ this ->createMock (Recipe::class),
373
+ $ this ->createMock (Recipe::class),
374
+ $ this ->createMock (Lock::class),
375
+ FLEX_TEST_DIR
376
+ );
377
+
378
+ @mkdir (FLEX_TEST_DIR .'/config ' );
379
+ file_put_contents (
380
+ FLEX_TEST_DIR .'/config/services.yaml ' ,
381
+ <<<EOF
382
+ parameters:
383
+ locale: es
384
+ something: else
385
+
386
+ services:
387
+ foo_router: '@router'
388
+ EOF
389
+ );
390
+
391
+ $ configurator ->update (
392
+ $ recipeUpdate ,
393
+ ['locale ' => 'en ' ],
394
+ []
395
+ );
396
+
397
+ $ this ->assertSame (['config/services.yaml ' => <<<EOF
398
+ parameters:
399
+ locale: en
400
+ something: else
401
+
402
+ services:
403
+ foo_router: '@router'
404
+ EOF
405
+ ], $ recipeUpdate ->getOriginalFiles ());
406
+
407
+ $ this ->assertSame (['config/services.yaml ' => <<<EOF
408
+ parameters:
409
+ something: else
410
+
411
+ services:
412
+ foo_router: '@router'
359
413
EOF
360
414
], $ recipeUpdate ->getNewFiles ());
361
415
}
0 commit comments