Author: Christer Edvartsen (cogo@starzinger.net)
Inheritance: extends Symfony\Component\Console\Command\Command
示例#1
0
 /**
  * @expectedException RuntimeException
  * @expectedExceptionMessage Could not generate private key
  * @covers ImboCli\Command\GeneratePrivateKey::execute
  */
 public function testFailsWhenItCantGenerateAPrivateKey()
 {
     $this->command->maxTries = 0;
     $commandTester = new CommandTester($this->command);
     $commandTester->execute(array('command' => $this->command->getName()));
 }
示例#2
0
 /**
  * Ask the user for a private key (or generate one if user does not specify)
  *
  * @param  InputInterface  $input
  * @param  OutputInterface $output
  * @return string
  */
 private function askForPrivateKey(InputInterface $input, OutputInterface $output)
 {
     $privateKeyGenerator = new GeneratePrivateKey();
     $question = new Question('What do you want the private key to be (leave blank to generate)', $privateKeyGenerator->generate());
     return $this->getHelper('question')->ask($input, $output, $question);
 }