Пример #1
0
 public function getCommandOutput(ConsoleCommand $command, $options)
 {
     $console = new Console();
     $cubex = new Cubex();
     $cubex->boot();
     $console->setCubex($cubex);
     $command->setApplication($console);
     $input = new ArrayInput(array_merge(['command' => $command->getName()], $options));
     $output = new BufferedOutput();
     $command->run($input, $output);
     return $output->fetch();
 }
Пример #2
0
 public function getConsole(InputInterface $input, OutputInterface $output)
 {
     $cubex = new Cubex();
     $console = Console::withCubex($cubex);
     $config = new TestConfigProvider();
     $config->addItem('console', 'commands', ['\\namespaced\\NamerCommand', 'phpserver' => 'CubexTest\\Cubex\\Console\\PhpWebServer', 'broken' => 'InvalidClass']);
     $config->addItem('console', 'patterns', ['\\namespaced\\sub\\%s']);
     $cubex->configure($config);
     $console->setCubex($cubex);
     $console->configure($input, $output);
     return $console;
 }