/**
  * Write in Memory for test.
  *
  * @param string $text
  *
  * @return  $this
  */
 protected function setStream($text)
 {
     $this->memory = fopen('php://memory', 'r+', false);
     fputs($this->memory, $text);
     rewind($this->memory);
     $this->instance->setInputStream($this->memory);
     return $this->memory;
 }
Example #2
0
 private function askForGuess($guess)
 {
     $prompter = new Prompter();
     $answer = $prompter->ask("Did you mean '{$guess}'?", array('Y', 'n'), 'Y');
     return !$answer || strtolower($answer) == 'y';
 }