Пример #1
0
 /**
  * @When /^I run "([^"]*)" command with interactive set: "([^"]*)"$/
  */
 public function iRunCommandWithInteractive($name, $set)
 {
     $command = $this->application->find($name);
     $set = explode(',', $set);
     $count = 0;
     $dialog = $this->getMock('Symfony\\Component\\Console\\Helper\\DialogHelper', array('ask'));
     $dialog->expects($this->any())->method('ask')->will($this->returnCallback(function () use($set, &$count) {
         return $set[$count++];
     }));
     $command->getHelperSet()->set($dialog, 'dialog');
     $this->tester = new CommandTester($command);
     $this->exitCode = $this->tester->execute(array('strategy' => $this->strategy), array('interactive' => false));
 }