/** * Tests to make sure we can output a string * * @return void **/ public function testOutputString() { $output = new Output(); $string = $this->getBuffered(function () use($output) { $output->addString('Hello, friend'); }); $this->assertEquals('\\033[0mHello, friend\\033[0m', $string, 'Output did not have the expected string without trailing new line'); }
/** * Show current output format * * @param \Hubzero\Console\Output $output The output object * @return void **/ public static function format($output) { $output->addString('The profile log has the following format ('); $output->addString('* indicates visible field', array('color' => 'blue')); $output->addLine('):'); $i = 0; foreach (static::$fields as $field => $status) { if ($i != 0) { $output->addString(' '); } $output->addString('<'); if ($i < 10) { $output->addString($i . ':'); } if ($status) { $output->addString('*' . $field, array('color' => 'blue')); } else { $output->addString($field); } $output->addString('>'); $i++; } $output->addSpacer()->addSpacer(); }