public function testInWithBadInput()
 {
     $command = new MockCommand(array('request' => $this->request));
     fwrite($command->request->input, "f\n");
     fwrite($command->request->input, 'y');
     rewind($command->request->input);
     $expected = "y";
     $result = $command->in('Everything Cool?', array('choices' => array('y', 'n')));
     $this->assertEqual($expected, $result);
 }
Beispiel #2
0
 public function testInWithOptions()
 {
     $command = new MockCommand(array('request' => $this->request));
     fwrite($command->request->input, 'y');
     rewind($command->request->input);
     $expected = "y";
     $result = $command->in('Everything Cool?', array('choices' => array('y', 'n')));
     $this->assertEqual($expected, $result);
     $expected = "Everything Cool? (y/n) \n > ";
     $result = $command->response->output;
     $this->assertEqual($expected, $result);
 }