/** * Runs composer command * * @param array $commandParams * @param string|null $workingDir * @return bool * @throws \RuntimeException */ public function runComposerCommand(array $commandParams, $workingDir = null) { $this->consoleApplication->resetComposer(); if ($workingDir) { $commandParams[self::COMPOSER_WORKING_DIR] = $workingDir; } else { $commandParams[self::COMPOSER_WORKING_DIR] = dirname($this->composerJson); } $input = $this->consoleArrayInputFactory->create($commandParams); $exitCode = $this->consoleApplication->run($input, $this->consoleOutput); if ($exitCode) { throw new \RuntimeException(sprintf('Command "%s" failed: %s', $commandParams['command'], $this->consoleOutput->fetch())); } return $this->consoleOutput->fetch(); }
public function testCreate() { $this->assertInstanceOf('\\Symfony\\Component\\Console\\Input\\ArrayInput', $this->factory->create([])); }