Example #1
0
 /**
  * @When I create a project named :project using the :template template and the answers:
  */
 public function iCreateAProjectNamedUsingTheTemplateAndTheAnswers($project, $template, TableNode $table)
 {
     $cmd = "php {$this->ketchBinary} create {$project} {$template}";
     $logger = new Yuloh\Expect\ConsoleLogger();
     $e = Expect::spawn($cmd, $this->cwd, $logger);
     foreach ($table->getHash() as $expectation) {
         $e->expect($expectation['question'], 5)->send($expectation['answer']);
     }
     $e->expect('Project ready!')->run();
 }
Example #2
0
 public function testEOFThrowsException()
 {
     $this->setExpectedException(Exceptions\UnexpectedEOFException::class);
     Expect::spawn('exec 1>&- && sleep 1s && kill $$')->expect('hola')->run();
 }