public function setUp() { $this->projectRoot = vfsStream::setup('project'); $this->installer = new ComponentInstaller(vfsStream::url('project')); $this->composer = $this->prophesize(Composer::class); $this->io = $this->prophesize(IOInterface::class); $this->installer->activate($this->composer->reveal(), $this->io->reveal()); $this->installationManager = $this->prophesize(InstallationManager::class); $this->composer->getInstallationManager()->willReturn($this->installationManager->reveal()); }
public function installPackage($config, $copyFilesKey) { /* TODO: First we need to set $composerDefinition, $composerRequires, $composerDevRequires and $stabilityFlags; // Add packages to install if (isset($config['packages'])) { foreach ($config['packages'] as $packageName) { OptionalPackages::addPackage($this->io, $packageName, $this->config['packages'][$packageName]); } }*/ // Copy files if (isset($config[$copyFilesKey])) { foreach ($config[$copyFilesKey] as $source => $target) { OptionalPackages::copyFile($this->io->reveal(), $this->projectRoot, $source, $target); } } }