Наследование: implements N98\Util\Console\Helper\Table\Renderer\RendererInterface
Пример #1
0
    /**
     * @test
     */
    public function rendering()
    {
        $renderer = new TextRenderer();
        $output = new StreamOutput(fopen('php://memory', 'w', false));
        $rows = array(array('Column1' => 'Value A1', 'Column2' => 'A2 is another value that there is'), array(1, "multi\nline\nftw"), array("C1 cell here!", new \SimpleXMLElement('<r>PHP Magic->toString() test</r>')));
        $expected = '+---------------+-----------------------------------+
| Column1       | Column2                           |
+---------------+-----------------------------------+
| Value A1      | A2 is another value that there is |
| 1             | multi                             |
|               | line                              |
|               | ftw                               |
| C1 cell here! | PHP Magic->toString() test        |
+---------------+-----------------------------------+' . "\n";
        $renderer->render($output, $rows);
        $this->assertEquals($expected, $this->getOutputBuffer($output));
    }