/** * Tests to make sure we can output a cool table * * @return void **/ public function testOutputTable() { $output = new Output(); $actual = $this->getBuffered(function () use($output) { $table = []; $table[] = ['John', 'Football']; $table[] = ['Stephen', 'Soccer']; $table[] = ['Ben', 'Baseball']; $output->addTable($table); }); $expected = '\\033[0m/--------------------\\\\033[0m\\n'; $expected .= '\\033[0m| \\033[0m\\033[0mJohn\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mFootball\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n'; $expected .= '\\033[0m| \\033[0m\\033[0mStephen\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mSoccer\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n'; $expected .= '\\033[0m| \\033[0m\\033[0mBen\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mBaseball\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n'; $expected .= '\\033[0m\\--------------------/\\033[0m\\n'; $this->assertEquals($expected, $actual, 'Output did not have the expected table'); }