PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\ObjectsChartTest::testTitleVisibility PHP Method

testTitleVisibility() public method

public testTitleVisibility ( )
    public function testTitleVisibility()
    {
        $oPhpPresentation = new PhpPresentation();
        $oSlide = $oPhpPresentation->getActiveSlide();
        $oShape = $oSlide->createChartShape();
        $oLine = new Line();
        $oShape->getPlotArea()->setType($oLine);
        $elementTitle = '/office:document-content/office:body/office:chart/chart:chart/chart:title';
        $elementStyle = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleTitle\']';
        $this->assertTrue($oShape->getTitle()->isVisible());
        $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $oShape->getTitle()->setVisible(true));
        $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
        $this->assertTrue($oXMLDoc->elementExists($elementTitle, 'Object 1/content.xml'));
        $this->assertTrue($oXMLDoc->elementExists($elementStyle, 'Object 1/content.xml'));
        $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $oShape->getTitle()->setVisible(false));
        $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
        $this->assertFalse($oXMLDoc->elementExists($elementTitle, 'Object 1/content.xml'));
        $this->assertFalse($oXMLDoc->elementExists($elementStyle, 'Object 1/content.xml'));
    }