|
15 | 15 | use PHPUnit\Framework\TestCase;
|
16 | 16 | use Symfony\Component\Filesystem\Filesystem;
|
17 | 17 | use Symfony\Component\Process\Process;
|
| 18 | +use Symfony\Flex\Lock; |
18 | 19 | use Symfony\Flex\Update\RecipePatch;
|
19 | 20 | use Symfony\Flex\Update\RecipePatcher;
|
20 | 21 |
|
@@ -52,7 +53,7 @@ public function testGeneratePatch(array $originalFiles, array $newFiles, string
|
52 | 53 | (new Process(['git', 'commit', '-m', '"original files"'], FLEX_TEST_DIR))->mustRun();
|
53 | 54 | }
|
54 | 55 |
|
55 |
| - $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class)); |
| 56 | + $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class), $this->createMock(Lock::class)); |
56 | 57 |
|
57 | 58 | $patch = $patcher->generatePatch($originalFiles, $newFiles);
|
58 | 59 | $this->assertSame($expectedPatch, rtrim($patch->getPatch(), "\n"));
|
@@ -189,7 +190,7 @@ public function testGeneratePatchOnDeletedFile()
|
189 | 190 | $this->getFilesystem()->remove(FLEX_TEST_DIR);
|
190 | 191 | $this->getFilesystem()->mkdir(FLEX_TEST_DIR);
|
191 | 192 |
|
192 |
| - $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class)); |
| 193 | + $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class), $this->createMock(Lock::class)); |
193 | 194 |
|
194 | 195 | // try to update a file that does not exist in the project
|
195 | 196 | $patch = $patcher->generatePatch(['.env' => 'original contents'], ['.env' => 'new contents']);
|
@@ -217,7 +218,7 @@ public function testApplyPatch(array $filesCurrentlyInApp, RecipePatch $recipePa
|
217 | 218 | (new Process(['git', 'commit', '-m', 'Committing original files'], FLEX_TEST_DIR))->mustRun();
|
218 | 219 | }
|
219 | 220 |
|
220 |
| - $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class)); |
| 221 | + $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class), $this->createMock(Lock::class)); |
221 | 222 | $hadConflicts = !$patcher->applyPatch($recipePatch);
|
222 | 223 |
|
223 | 224 | foreach ($expectedFiles as $file => $expectedContents) {
|
@@ -261,7 +262,7 @@ public function testApplyPatchOnSubfolder(array $filesCurrentlyInApp, RecipePatc
|
261 | 262 | (new Process(['git', 'commit', '-m', 'Committing original files'], $subProjectPath))->mustRun();
|
262 | 263 | }
|
263 | 264 |
|
264 |
| - $patcher = new RecipePatcher($subProjectPath, $this->createMock(IOInterface::class)); |
| 265 | + $patcher = new RecipePatcher($subProjectPath, $this->createMock(IOInterface::class), $this->createMock(Lock::class)); |
265 | 266 | $hadConflicts = !$patcher->applyPatch($recipePatch);
|
266 | 267 |
|
267 | 268 | foreach ($expectedFiles as $file => $expectedContents) {
|
@@ -390,7 +391,7 @@ public function testIntegration(bool $useNullForMissingFiles)
|
390 | 391 | (new Process(['git', 'add', '-A'], FLEX_TEST_DIR))->mustRun();
|
391 | 392 | (new Process(['git', 'commit', '-m', 'committing in app start files'], FLEX_TEST_DIR))->mustRun();
|
392 | 393 |
|
393 |
| - $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class)); |
| 394 | + $patcher = new RecipePatcher(FLEX_TEST_DIR, $this->createMock(IOInterface::class), $this->createMock(Lock::class)); |
394 | 395 | $originalFiles = [
|
395 | 396 | '.env' => $files['dot_env_clean']['original_recipe'],
|
396 | 397 | 'package.json' => $files['package_json_conflict']['original_recipe'],
|
|
0 commit comments