PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\ContentTest::testTableCellFill PHP Method

testTableCellFill() public method

public testTableCellFill ( )
    public function testTableCellFill()
    {
        $oColor = new Color();
        $oColor->setRGB(Color::COLOR_BLUE);
        $oFill = new Fill();
        $oFill->setFillType(Fill::FILL_SOLID)->setStartColor($oColor);
        $phpPresentation = new PhpPresentation();
        $oSlide = $phpPresentation->getActiveSlide();
        $oShape = $oSlide->createTableShape();
        $oRow = $oShape->createRow();
        $oCell = $oRow->getCell();
        $oCell->setFill($oFill);
        $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
        $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1r0c0\']';
        $this->assertTrue($pres->elementExists($element, 'content.xml'));
        $this->assertEquals('table-cell', $pres->getElementAttribute($element, 'style:family', 'content.xml'));
        $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1r0c0\']/style:graphic-properties';
        $this->assertTrue($pres->elementExists($element, 'content.xml'));
        $this->assertEquals('solid', $pres->getElementAttribute($element, 'draw:fill', 'content.xml'));
        $this->assertStringStartsWith('#', $pres->getElementAttribute($element, 'draw:fill-color', 'content.xml'));
        $this->assertStringEndsWith($oColor->getRGB(), $pres->getElementAttribute($element, 'draw:fill-color', 'content.xml'));
    }