1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

Execute all operations at once which lets us download all packages in parallel then install only once all downloads succeeded, fixes #2847

This also changes the PRE/POST_PACKAGE_INSTALL/UPDATE/UNINSTALL events to have less information available on them, repositorySet, request and policy are gone
This commit is contained in:
Jordi Boggiano 2019-11-14 15:20:50 +01:00
parent 3b6d517ce0
commit 006985a0ea
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
12 changed files with 222 additions and 123 deletions

View file

@ -23,10 +23,10 @@ class InstallerEventTest extends TestCase
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
$policy = $this->getMockBuilder('Composer\DependencyResolver\PolicyInterface')->getMock();
$repositorySet = $this->getMockBuilder('Composer\Repository\RepositorySet')->disableOriginalConstructor()->getMock();
$installedRepo = $this->getMockBuilder('Composer\Repository\CompositeRepository')->disableOriginalConstructor()->getMock();
$localRepo = $this->getMockBuilder('Composer\Repository\CompositeRepository')->disableOriginalConstructor()->getMock();
$request = $this->getMockBuilder('Composer\DependencyResolver\Request')->disableOriginalConstructor()->getMock();
$operations = array($this->getMockBuilder('Composer\DependencyResolver\Operation\OperationInterface')->getMock());
$event = new InstallerEvent('EVENT_NAME', $composer, $io, true, $policy, $repositorySet, $installedRepo, $request, $operations);
$event = new InstallerEvent('EVENT_NAME', $composer, $io, true, $policy, $repositorySet, $localRepo, $request, $operations);
$this->assertSame('EVENT_NAME', $event->getName());
$this->assertInstanceOf('Composer\Composer', $event->getComposer());
@ -34,7 +34,7 @@ class InstallerEventTest extends TestCase
$this->assertTrue($event->isDevMode());
$this->assertInstanceOf('Composer\DependencyResolver\PolicyInterface', $event->getPolicy());
$this->assertInstanceOf('Composer\Repository\RepositorySet', $event->getRepositorySet());
$this->assertInstanceOf('Composer\Repository\CompositeRepository', $event->getInstalledRepo());
$this->assertInstanceOf('Composer\Repository\RepositoryInterface', $event->getLocalRepo());
$this->assertInstanceOf('Composer\DependencyResolver\Request', $event->getRequest());
$this->assertCount(1, $event->getOperations());
}