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:
parent
e753bf08b1
commit
e8c6948770
3 changed files with 230 additions and 112 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue