public function testGetSetInitials() { $expectedVal = 'AABBCCDD'; $object = new Author(); $this->assertNull($object->getInitials()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Comment\\Author', $object->setInitials($expectedVal)); $this->assertEquals($expectedVal, $object->getInitials()); }
public function testComments() { $expectedElement = '/p:cmAuthorLst/p:cmAuthor'; $expectedName = 'Name'; $expectedInitials = 'Initials'; $oAuthor = new Comment\Author(); $oAuthor->setName($expectedName); $oAuthor->setInitials($expectedInitials); $oComment = new Comment(); $oComment->setAuthor($oAuthor); $this->oPresentation->getActiveSlide()->addShape($oComment); $pres = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007'); $this->assertTrue($pres->fileExists('ppt/commentAuthors.xml')); $this->assertTrue($pres->elementExists($expectedElement, 'ppt/commentAuthors.xml')); $this->assertEquals(0, $pres->getElementAttribute($expectedElement, 'id', 'ppt/commentAuthors.xml')); $this->assertEquals($expectedName, $pres->getElementAttribute($expectedElement, 'name', 'ppt/commentAuthors.xml')); $this->assertEquals($expectedInitials, $pres->getElementAttribute($expectedElement, 'initials', 'ppt/commentAuthors.xml')); }