public function onPostDependenciesSolving(Installer\InstallerEvent $ev) { if ($this->disabled) { return; } $prefetcher = new Prefetcher(); $prefetcher->fetchAllFromOperations($this->io, $this->config, $ev->getOperations()); }
public function testOnPostDependenciesSolving() { $plugin = new Plugin(); $plugin->activate($this->composerp->reveal(), $this->iop->reveal()); $evp = $this->prophesize('Composer\\Installer\\InstallerEvent'); $evp->getOperations()->willReturn($this->createDummyOperations()); // on enabled $plugin->onPostDependenciesSolving($evp->reveal()); // on disabled $plugin->disable(); $evp = $this->prophesize('Composer\\Installer\\InstallerEvent'); $evp->getOperations()->shouldNotBeCalled(); $plugin->onPostDependenciesSolving($evp->reveal()); }