PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\ObjectsChartTest::testAxisFont PHP Метод

testAxisFont() публичный Метод

public testAxisFont ( )
    public function testAxisFont()
    {
        $oPhpPresentation = new PhpPresentation();
        $oSlide = $oPhpPresentation->getActiveSlide();
        $oShape = $oSlide->createChartShape();
        $oSeries = new Series('Series', array('Jan' => 1, 'Feb' => 5, 'Mar' => 2));
        $oBar = new Bar();
        $oBar->addSeries($oSeries);
        $oShape->getPlotArea()->setType($oBar);
        $oShape->getPlotArea()->getAxisX()->getFont()->getColor()->setRGB('AABBCC');
        $oShape->getPlotArea()->getAxisX()->getFont()->setItalic(true);
        $oShape->getPlotArea()->getAxisY()->getFont()->getColor()->setRGB('00FF00');
        $oShape->getPlotArea()->getAxisY()->getFont()->setSize(16);
        $oShape->getPlotArea()->getAxisY()->getFont()->setName('Arial');
        $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
        $this->assertTrue($oXMLDoc->fileExists('Object 1/content.xml'));
        $element = '/office:document-content/office:body/office:chart/chart:chart';
        $this->assertTrue($oXMLDoc->elementExists($element, 'Object 1/content.xml'));
        $this->assertEquals('chart:bar', $oXMLDoc->getElementAttribute($element, 'chart:class', 'Object 1/content.xml'));
        $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleAxisX\']/style:text-properties';
        $this->assertTrue($oXMLDoc->elementExists($element, 'Object 1/content.xml'));
        $this->assertEquals('#AABBCC', $oXMLDoc->getElementAttribute($element, 'fo:color', 'Object 1/content.xml'));
        //Color XAxis
        $this->assertEquals('italic', $oXMLDoc->getElementAttribute($element, 'fo:font-style', 'Object 1/content.xml'));
        //Italic XAxis
        $this->assertEquals('10pt', $oXMLDoc->getElementAttribute($element, 'fo:font-size', 'Object 1/content.xml'));
        //Size XAxis
        $this->assertEquals('Calibri', $oXMLDoc->getElementAttribute($element, 'fo:font-family', 'Object 1/content.xml'));
        //Size XAxis
        $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleAxisY\']/style:text-properties';
        $this->assertTrue($oXMLDoc->elementExists($element, 'Object 1/content.xml'));
        $this->assertEquals('#00FF00', $oXMLDoc->getElementAttribute($element, 'fo:color', 'Object 1/content.xml'));
        //Color YAxis
        $this->assertEquals('normal', $oXMLDoc->getElementAttribute($element, 'fo:font-style', 'Object 1/content.xml'));
        //Italic YAxis
        $this->assertEquals('16pt', $oXMLDoc->getElementAttribute($element, 'fo:font-size', 'Object 1/content.xml'));
        //Size YAxis
        $this->assertEquals('Arial', $oXMLDoc->getElementAttribute($element, 'fo:font-family', 'Object 1/content.xml'));
        //Size YAxis
    }