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:
parent
5805a68645
commit
4e6d54b731
25 changed files with 120 additions and 330 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue