PhpOffice\PhpPresentation\Tests\Writer\PowerPoint2007\SlideTest::testTableWithBorder PHP Method

testTableWithBorder() public method

public testTableWithBorder ( )
    public function testTableWithBorder()
    {
        $oPhpPresentation = new PhpPresentation();
        $oSlide = $oPhpPresentation->getActiveSlide();
        $oShape = $oSlide->createTableShape(4);
        $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300);
        $oRow = $oShape->createRow();
        $oCell = $oRow->getCell(1);
        $oCell->createTextRun('AAA');
        $oCell->getBorders()->getBottom()->setDashStyle(Border::DASH_DASH);
        $oCell->getBorders()->getBottom()->setLineStyle(Border::LINE_DOUBLE);
        $oCell->getBorders()->getTop()->setDashStyle(Border::DASH_DASHDOT);
        $oCell->getBorders()->getTop()->setLineStyle(Border::LINE_SINGLE);
        $oCell->getBorders()->getRight()->setDashStyle(Border::DASH_DOT);
        $oCell->getBorders()->getRight()->setLineStyle(Border::LINE_THICKTHIN);
        $oCell->getBorders()->getLeft()->setDashStyle(Border::DASH_LARGEDASH);
        $oCell->getBorders()->getLeft()->setLineStyle(Border::LINE_THINTHICK);
        $oCell = $oRow->nextCell();
        $oCell->createTextRun('BBB');
        $oCell->getBorders()->getRight()->setDashStyle(Border::DASH_LARGEDASHDOT);
        $oCell->getBorders()->getRight()->setLineStyle(Border::LINE_TRI);
        $oRow = $oShape->createRow();
        $oCell = $oRow->getCell(1);
        $oCell->createTextRun('CCC');
        $oCell->getBorders()->getBottom()->setDashStyle(Border::DASH_LARGEDASHDOTDOT);
        $oCell->getBorders()->getBottom()->setLineStyle(Border::LINE_NONE);
        $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
        $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr';
        $this->assertTrue($pres->elementExists($element . '/a:lnL[@cmpd="' . Border::LINE_THINTHICK . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnL[@cmpd="' . Border::LINE_THINTHICK . '"]/a:prstDash[@val="' . Border::DASH_LARGEDASH . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnR[@cmpd="' . Border::LINE_THICKTHIN . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnR[@cmpd="' . Border::LINE_THICKTHIN . '"]/a:prstDash[@val="' . Border::DASH_DOT . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnT[@cmpd="' . Border::LINE_SINGLE . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnT[@cmpd="' . Border::LINE_SINGLE . '"]/a:prstDash[@val="' . Border::DASH_DASHDOT . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnB[@cmpd="' . Border::LINE_SINGLE . '"]', 'ppt/slides/slide1.xml'));
        $this->assertTrue($pres->elementExists($element . '/a:lnB[@cmpd="' . Border::LINE_SINGLE . '"]/a:prstDash[@val="' . Border::DASH_SOLID . '"]', 'ppt/slides/slide1.xml'));
    }