/** * @When /^(?:|I )run phpspec and answer "(?P<answer>[^"]*)" when asked if I want to generate the code$/ */ public function iRunPhpspecAndAnswer($answer) { $this->applicationTester = $this->createApplicationTester(); $this->applicationTester->putToInputStream(sprintf("%s\n", $answer)); $this->applicationTester->run('run', array('interactive' => true, 'decorated' => false)); }