示例#1
0
 /**
  * Create a helper for executing command-tests in our application.
  *
  * @param array $args must include key "command"
  * @return \Symfony\Component\Console\Tester\CommandTester
  */
 public function createCommandTester($args)
 {
     if (!isset($args['command'])) {
         throw new \RuntimeException("Missing mandatory argument: command");
     }
     $application = new Application();
     $command = $application->find($args['command']);
     $commandTester = new CommandTester($command);
     $commandTester->execute($args);
     return $commandTester;
 }
示例#2
0
文件: CliCommand.php 项目: civicrm/cv
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->boot($input, $output);
     $cv = new Application();
     $sh = new \Psy\Shell();
     $sh->addCommands($cv->createCommands());
     // When I try making a new matcher, it doesn't seem to get called.
     //$sh->addTabCompletionMatchers(array(
     //  new ApiMatcher(),
     //));
     $sh->run();
 }
示例#3
0
 /**
  * Primary entry point for execution of the standalone command.
  */
 public static function main($binDir)
 {
     $application = new Application('cv', '@package_version@');
     $application->run();
 }