getOutputContent example

protected function tearDown(): void
    {
        unset($this->stream);
    }

    public function testMoveUpOneLine()
    {
        $cursor = new Cursor($output = $this->getOutputStream());

        $cursor->moveUp();

        $this->assertEquals("\x1b[1A", $this->getOutputContent($output));
    }

    public function testMoveUpMultipleLines()
    {
        $cursor = new Cursor($output = $this->getOutputStream());

        $cursor->moveUp(12);

        $this->assertEquals("\x1b[12A", $this->getOutputContent($output));
    }

    

    public function testRender($headers$rows$style$expected$decorated = false)
    {
        $table = new Table($output = $this->getOutputStream($decorated));
        $table
            ->setHeaders($headers)
            ->setRows($rows)
            ->setStyle($style)
        ;
        $table->render();

        $this->assertEquals($expected$this->getOutputContent($output));
    }

    /** * @dataProvider renderProvider */
    public function testRenderAddRows($headers$rows$style$expected$decorated = false)
    {
        $table = new Table($output = $this->getOutputStream($decorated));
        $table
            ->setHeaders($headers)
            ->addRows($rows)
            
Home | Imprint | This part of the site doesn't use cookies.