Search only for packages from the local repository in the locker
parent
1ca3e5e5e2
commit
36a724fa51
|
@ -61,7 +61,7 @@ class Locker
|
|||
$lockList = $this->lockFile->read();
|
||||
$packages = array();
|
||||
foreach ($lockList as $info) {
|
||||
$package = $this->repositoryManager->findPackage($info['package'], $info['version']);
|
||||
$package = $this->repositoryManager->getLocalRepository()->findPackage($info['package'], $info['version']);
|
||||
|
||||
if (!$package) {
|
||||
throw new \LogicException(sprintf(
|
||||
|
|
|
@ -68,7 +68,7 @@ class LockerTest extends \PHPUnit_Framework_TestCase
|
|||
$package1 = $this->createPackageMock();
|
||||
$package2 = $this->createPackageMock();
|
||||
|
||||
$repo
|
||||
$repo->getLocalRepository()
|
||||
->expects($this->exactly(2))
|
||||
->method('findPackage')
|
||||
->with($this->logicalOr('pkg1', 'pkg2'), $this->logicalOr('1.0.0-beta', '0.1.10'))
|
||||
|
@ -99,7 +99,7 @@ class LockerTest extends \PHPUnit_Framework_TestCase
|
|||
$package1 = $this->createPackageMock();
|
||||
$package2 = $this->createPackageMock();
|
||||
|
||||
$repo
|
||||
$repo->getLocalRepository()
|
||||
->expects($this->exactly(2))
|
||||
->method('findPackage')
|
||||
->with($this->logicalOr('pkg1', 'pkg2'), $this->logicalOr('1.0.0-beta', '0.1.10'))
|
||||
|
@ -176,9 +176,15 @@ class LockerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
private function createRepositoryManagerMock()
|
||||
{
|
||||
return $this->getMockBuilder('Composer\Repository\RepositoryManager')
|
||||
$mock = $this->getMockBuilder('Composer\Repository\RepositoryManager')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('getLocalRepository')
|
||||
->will($this->returnValue($this->getMockBuilder('Composer\Repository\ArrayRepository')->getMock()));
|
||||
|
||||
return $mock;
|
||||
}
|
||||
|
||||
private function createPackageMock()
|
||||
|
|
Loading…
Reference in New Issue