public static function getTester($cmd_name) { $app = new Application(); $app->configure(new ArrayInput(array()), new StreamOutput(fopen('php://memory', 'w', false))); $app->setEntryPoint(self::getEntryPointInstance()); $app->registerAllCommands(); $command = $app->find($cmd_name); return (object) array('tester' => new CommandTester($command), 'app' => $app, 'command' => $command); }
public function getCommandTester($cmd_name = 'user:update') { $app = new Application(); $app->configure(new ArrayInput(array()), new StreamOutput(fopen('php://memory', 'w', false))); $app->setEntryPoint($this->getEntryPointInstance()); $app->registerAllCommands(); $this->command = $app->find($cmd_name); return new CommandTester($this->command); }