public function testVisible() { $object = new Title(); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible()); $this->assertTrue($object->isVisible()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible(true)); $this->assertTrue($object->isVisible()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible(false)); $this->assertFalse($object->isVisible()); }
/** * @param Title $oTitle */ private function writeTitleStyle(Title $oTitle) { if ($oTitle->isVisible()) { // style:style $this->xmlContent->startElement('style:style'); $this->xmlContent->writeAttribute('style:name', 'styleTitle'); $this->xmlContent->writeAttribute('style:family', 'chart'); // style:text-properties $this->xmlContent->startElement('style:text-properties'); $this->xmlContent->writeAttribute('fo:color', '#' . $oTitle->getFont()->getColor()->getRGB()); $this->xmlContent->writeAttribute('fo:font-family', $oTitle->getFont()->getName()); $this->xmlContent->writeAttribute('fo:font-size', $oTitle->getFont()->getSize() . 'pt'); $this->xmlContent->writeAttribute('fo:font-style', $oTitle->getFont()->isItalic() ? 'italic' : 'normal'); // > style:text-properties $this->xmlContent->endElement(); // > style:style $this->xmlContent->endElement(); } }