/** * 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); }
/** * 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); }
/** * A specialized print function for terminfo caps * * Only echo the text if the stdout is a tty * * @param mixed $text The text to print * @return void */ public function printterm($text) { if ($this->_isatty) { Qi_Console_Std::out($text); } }