/** * Instantiate the controller. * * @param Command $command The command object. */ public function __construct(Command $command) { // Setup dependencies. $this->app = $command->getApplication(); $this->input = $command->getInput() ?: new Input\Cli(); $this->command = $command; }
/** * Test renderAlternatives. * * @return void * * @since 1.0 * * @covers Joomla\Console\Command\AbstractCommand::renderAlternatives */ public function testRenderAlternatives() { $compare = 'Command "yo" not found. Did you mean one of these? yoo'; $this->instance->getInput()->args = array('yo'); $this->instance->getInput()->set('no-ansi', 1); $this->instance->execute(); $this->assertEquals(str_replace(array("\n", "\r"), '', trim($compare)), str_replace(array("\n", "\r"), '', trim($this->instance->getOutput()->getOutput()))); }