public function testGetSetDate() { $expectedDate = time(); $object = new Comment(); $this->assertInternalType('int', $object->getDate()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Comment', $object->setDate($expectedDate)); $this->assertEquals($expectedDate, $object->getDate()); $this->assertInternalType('int', $object->getDate()); }
/** * Write Comment * @param XMLWriter $objWriter * @param Comment $oShape */ public function writeShapeComment(XMLWriter $objWriter, Comment $oShape) { // officeooo:annotation $objWriter->startElement('officeooo:annotation'); $objWriter->writeAttribute('svg:x', number_format(CommonDrawing::pixelsToCentimeters($oShape->getOffsetX()), 2, '.', '') . 'cm'); $objWriter->writeAttribute('svg:y', number_format(CommonDrawing::pixelsToCentimeters($oShape->getOffsetY()), 2, '.', '') . 'cm'); if ($oShape->getAuthor() instanceof Comment\Author) { $objWriter->writeElement('dc:creator', $oShape->getAuthor()->getName()); } $objWriter->writeElement('dc:date', date('Y-m-d\\TH:i:s', $oShape->getDate())); $objWriter->writeElement('text:p', $oShape->getText()); // ## officeooo:annotation $objWriter->endElement(); }