Skip to content

Commit 06a8fea

Browse files
committed
Keep only minimal information for the package lock
1 parent 7c7a216 commit 06a8fea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Flex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ function ($value) {
420420
'n'
421421
);
422422
if ('n' === $answer) {
423-
// Remove the recipe from the lock to allow re-asking next time
424-
$this->lock->remove($recipe->getName());
423+
// Keep the package in lock but without recipe info, so the recipe can be applied later
424+
$this->lock->set($recipe->getName(), ['version' => $recipe->getPackage()->getPrettyVersion()]);
425425
continue;
426426
}
427427
if ('a' === $answer) {

tests/FlexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
class FlexTest extends TestCase
4646
{
47-
public function tearDown(): void
47+
protected function tearDown(): void
4848
{
4949
@unlink(__DIR__.'/Fixtures/symfony.lock');
5050
}
@@ -171,7 +171,7 @@ public function testContribRecipeNotApprovedIsRemovedFromLock()
171171

172172
$flex->record($this->mockPackageEvent($package));
173173
$flex->install($this->mockFlexEvent());
174-
$this->assertFalse($lock->has('contrib/package'), 'Recipe lock entry has been removed');
174+
$this->assertSame(['version' => '1.0.0'], $lock->get('contrib/package'));
175175

176176
// Verify the warning message was displayed
177177
$output = $io->getOutput();

0 commit comments

Comments
 (0)