1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Deduplicate link instances between versions of a given package

This commit is contained in:
Jordi Boggiano 2018-12-04 11:20:35 +01:00
parent e753bf08b1
commit e8c6948770
3 changed files with 230 additions and 112 deletions

View file

@ -32,7 +32,7 @@ class ComposerRepositoryTest extends TestCase
);
$repository = $this->getMockBuilder('Composer\Repository\ComposerRepository')
->setMethods(array('loadRootServerFile', 'createPackage'))
->setMethods(array('loadRootServerFile', 'createPackages'))
->setConstructorArgs(array(
$repoConfig,
new NullIO,
@ -47,16 +47,17 @@ class ComposerRepositoryTest extends TestCase
->method('loadRootServerFile')
->will($this->returnValue($repoPackages));
$stubs = array();
foreach ($expected as $at => $arg) {
$stubPackage = $this->getPackage('stub/stub', '1.0.0');
$repository
->expects($this->at($at + 2))
->method('createPackage')
->with($this->identicalTo($arg), $this->equalTo('Composer\Package\CompletePackage'))
->will($this->returnValue($stubPackage));
$stubs[] = $this->getPackage('stub/stub', '1.0.0');
}
$repository
->expects($this->at(2))
->method('createPackages')
->with($this->identicalTo($expected), $this->equalTo('Composer\Package\CompletePackage'))
->will($this->returnValue($stubs));
// Triggers initialization
$packages = $repository->getPackages();