/**
  * @When I run phpspec and answer :answer when asked if I want to generate the code
  * @When I run phpspec with the option :option and (I) answer :answer when asked if I want to generate the code
  */
 public function iRunPhpspecAndAnswerWhenAskedIfIWantToGenerateTheCode($answer, $option = null)
 {
     $arguments = array('command' => 'run');
     $this->addOptionToArguments($option, $arguments);
     $this->prompter->setAnswer($answer == 'y');
     $this->lastExitCode = $this->tester->run($arguments, array('interactive' => true));
 }
 /**
  * @When I run phpspec with the :config (custom) config and answer :answer when asked if I want to generate the code
  */
 public function iRunPhpspecWithConfigAndAnswerIfIWantToGenerateTheCode($config, $answer)
 {
     $arguments = array('command' => 'run', '--config' => $config);
     $this->prompter->setAnswer($answer == 'y');
     $this->lastExitCode = $this->tester->run($arguments, array('interactive' => true));
 }
Пример #3
0
 /**
  * @Then I should be prompted with:
  */
 public function iShouldBePromptedWith(PyStringNode $question)
 {
     $prompt = $this->prompter->getPrompt();
     expect($prompt)->toBeLike((string) $question);
 }