PhpPresentation\Tests\Writer\PowerPoint2007\PptChartsTest::testTypeLineSeriesOutline PHP Method

testTypeLineSeriesOutline() public method

    public function testTypeLineSeriesOutline()
    {
        $expectedWidth = rand(1, 100);
        $expectedWidthEmu = Drawing::pixelsToEmu(Drawing::pointsToPixels($expectedWidth));
        $expectedElement = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:spPr/a:ln';
        $oOutline = new Outline();
        // Define the color
        $oOutline->getFill()->setFillType(Fill::FILL_SOLID);
        $oOutline->getFill()->setStartColor(new Color(Color::COLOR_YELLOW));
        // Define the width (in points)
        $oOutline->setWidth($expectedWidth);
        $oSlide = $this->oPresentation->getActiveSlide();
        $oShape = $oSlide->createChartShape();
        $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80);
        $oLine = new Line();
        $oSeries = new Series('Downloads', $this->seriesData);
        $oLine->addSeries($oSeries);
        $oShape->getPlotArea()->setType($oLine);
        $oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
        $this->assertTrue($oXMLDoc->fileExists('ppt/charts/' . $oShape->getIndexedFilename()));
        $this->assertFalse($oXMLDoc->elementExists($expectedElement, 'ppt/charts/' . $oShape->getIndexedFilename()));
        $oSeries->setOutline($oOutline);
        $oLine->setSeries(array($oSeries));
        $oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
        $this->assertTrue($oXMLDoc->fileExists('ppt/charts/' . $oShape->getIndexedFilename()));
        $this->assertTrue($oXMLDoc->elementExists($expectedElement, 'ppt/charts/' . $oShape->getIndexedFilename()));
        $this->assertEquals($expectedWidthEmu, $oXMLDoc->getElementAttribute($expectedElement, 'w', 'ppt/charts/' . $oShape->getIndexedFilename()));
        $this->assertTrue($oXMLDoc->elementExists($expectedElement . '/a:solidFill', 'ppt/charts/' . $oShape->getIndexedFilename()));
    }