Make sure a lock file is always written and things work well even without any dependencies in the require/require-dev
parent
173b96de2d
commit
292d4b3c8f
|
@ -345,18 +345,6 @@ class Locker
|
|||
$lock['platform-overrides'] = $platformOverrides;
|
||||
}
|
||||
|
||||
if (empty($lock['packages']) && empty($lock['packages-dev']) && empty($lock['platform']) && empty($lock['platform-dev'])) {
|
||||
if ($this->lockFile->exists()) {
|
||||
if ($write) {
|
||||
unlink($this->lockFile->getPath());
|
||||
} else {
|
||||
$this->virtualFileWritten = false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$isLocked = $this->isLocked();
|
||||
} catch (ParsingException $e) {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
--TEST--
|
||||
Update to a state without dependency works well from a blank slate
|
||||
--COMPOSER--
|
||||
{
|
||||
}
|
||||
--RUN--
|
||||
update
|
||||
--EXPECT-LOCK--
|
||||
{
|
||||
"packages": [],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
--EXPECT--
|
|
@ -0,0 +1,47 @@
|
|||
--TEST--
|
||||
Update to a state without dependency works well from locked with dependency
|
||||
--COMPOSER--
|
||||
{
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
--INSTALLED--
|
||||
[
|
||||
{
|
||||
"name": "a/a", "version": "dev-master",
|
||||
"source": { "reference": "1234", "type": "git", "url": "" }
|
||||
}
|
||||
]
|
||||
--LOCK--
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "a/a", "version": "dev-master",
|
||||
"source": { "reference": "1234", "type": "git", "url": "" },
|
||||
"type": "library"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
--RUN--
|
||||
update
|
||||
--EXPECT-LOCK--
|
||||
{
|
||||
"packages": [],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
--EXPECT--
|
||||
Uninstalling a/a (dev-master 1234)
|
Loading…
Reference in New Issue