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

Fix all 5.3 $this-in-closure usages

This commit is contained in:
Jordi Boggiano 2022-01-03 15:40:32 +01:00
parent 5805a68645
commit 4e6d54b731
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
25 changed files with 120 additions and 330 deletions

View file

@ -37,7 +37,7 @@ class ComposerRepositoryTest extends TestCase
);
$repository = $this->getMockBuilder('Composer\Repository\ComposerRepository')
->onlyMethods(array('loadRootServerFile', 'createPackages'))
->onlyMethods(array('loadRootServerFile'))
->setConstructorArgs(array(
$repoConfig,
new NullIO,
@ -52,22 +52,15 @@ class ComposerRepositoryTest extends TestCase
->method('loadRootServerFile')
->will($this->returnValue($repoPackages));
$stubs = array();
foreach ($expected as $at => $arg) {
$stubs[] = $this->getPackage('stub/stub', '1.0.0');
}
$repository
->expects($this->once())
->method('createPackages')
->with($this->identicalTo($expected), $this->equalTo('root file (http://example.org/packages.json)'))
->will($this->returnValue($stubs));
// Triggers initialization
$packages = $repository->getPackages();
// Final sanity check, ensure the correct number of packages were added.
$this->assertCount(count($expected), $packages);
foreach ($expected as $index => $pkg) {
self::assertSame($pkg['name'].' '.$pkg['version'], $packages[$index]->getName().' '.$packages[$index]->getPrettyVersion());
}
}
public function loadDataProvider()