Пример #1
0
 /**
  * Test out method
  * 
  * @return void
  */
 public function testOut()
 {
     ob_start();
     Qi_Console_Std::out('text');
     $result = ob_get_contents();
     ob_end_clean();
     $this->assertEquals('text', $result);
 }
Пример #2
0
 /**
  * Prompt the user and gather the input
  *
  * @param string $prompt The text of the prompt
  * @param mixed $default The default prompt string
  * @return string The input from user
  */
 public function prompt($prompt, $default = null)
 {
     Qi_Console_Std::out("\n" . $prompt);
     return Qi_Console_Std::in('fgets', $default);
 }
Пример #3
0
 /**
  * Prompt the user for input
  *
  * @param string $text The text string with the prompt message
  * @return object Terminal self (to allow for chaining)
  */
 public function prompt($text)
 {
     print $text;
     return Qi_Console_Std::in();
 }