Add plugin-api-version used to generate a lock file in itself
parent
c4f19e51d8
commit
0b9c658bef
|
@ -19,6 +19,7 @@ use Composer\Util\ProcessExecutor;
|
|||
use Composer\Repository\ArrayRepository;
|
||||
use Composer\Package\Dumper\ArrayDumper;
|
||||
use Composer\Package\Loader\ArrayLoader;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
use Composer\Util\Git as GitUtil;
|
||||
use Composer\IO\IOInterface;
|
||||
use Seld\JsonLint\ParsingException;
|
||||
|
@ -322,6 +323,7 @@ class Locker
|
|||
if ($platformOverrides) {
|
||||
$lock['platform-overrides'] = $platformOverrides;
|
||||
}
|
||||
$lock['plugin-api-version'] = PluginInterface::PLUGIN_API_VERSION;
|
||||
|
||||
if (empty($lock['packages']) && empty($lock['packages-dev']) && empty($lock['platform']) && empty($lock['platform-dev'])) {
|
||||
if ($this->lockFile->exists()) {
|
||||
|
|
|
@ -262,6 +262,7 @@ class InstallerTest extends TestCase
|
|||
unset($actualLock['hash']);
|
||||
unset($actualLock['content-hash']);
|
||||
unset($actualLock['_readme']);
|
||||
unset($actualLock['plugin-api-version']);
|
||||
$this->assertEquals($expectLock, $actualLock);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
namespace Composer\Test\Package;
|
||||
|
||||
use Composer\Package\Locker;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
use Composer\IO\NullIO;
|
||||
use Composer\Test\TestCase;
|
||||
|
||||
|
@ -154,6 +155,7 @@ class LockerTest extends TestCase
|
|||
'platform-overrides' => array('foo/bar' => '1.0'),
|
||||
'prefer-stable' => false,
|
||||
'prefer-lowest' => false,
|
||||
'plugin-api-version' => PluginInterface::PLUGIN_API_VERSION,
|
||||
));
|
||||
|
||||
$locker->setLockData(array($package1, $package2), array(), array(), array(), array(), 'dev', array(), false, false, array('foo/bar' => '1.0'));
|
||||
|
|
Loading…
Reference in New Issue