/** * @param array $arguments */ public function run(array $arguments) { try { $this->setArguments($arguments); $commandName = 'list'; if (isset($this->arguments[0])) { $commandName = array_shift($this->arguments); } $this->processCommand($commandName); $outputWriter = $this->getOutputWriter(); $this->command->setOutputWriter($outputWriter); $success = $this->command->execute(); if ($success === true) { $outputWriter->writeLine("Command '{$commandName}' has run successfully", OutputWriterInterface::LEVEL_VERBOSE); } else { $outputWriter->writeLine("Run of command '{$commandName}' has FAILED!", OutputWriterInterface::LEVEL_LESS_INFO); } } catch (\Exception $e) { $this->handleException($e); } }
/** * @param array $expectedParams */ private function thenExceptPopulatedParams(array $expectedParams) { $this->assertEquals($expectedParams, $this->command->getParams()); }