setName($expectedName); $oAuthor->setInitials($expectedInitials); $oComment = new Comment(); $oComment->setAuthor($oAuthor); $this->oPresentation->getActiveSlide()->addShape($oComment); $this->assertZipFileExists('ppt/commentAuthors.xml'); $this->assertZipXmlElementExists('ppt/commentAuthors.xml', $expectedElement); $this->assertZipXmlAttributeEquals('ppt/commentAuthors.xml', $expectedElement, 'id', 0); $this->assertZipXmlAttributeEquals('ppt/commentAuthors.xml', $expectedElement, 'name', $expectedName); $this->assertZipXmlAttributeEquals('ppt/commentAuthors.xml', $expectedElement, 'initials', $expectedInitials); } public function testWithoutComment() { $this->assertZipFileNotExists('ppt/commentAuthors.xml'); } public function testWithoutCommentAuthor() { $oComment = new Comment(); $this->oPresentation->getActiveSlide()->addShape($oComment); $this->assertZipFileNotExists('ppt/commentAuthors.xml'); } public function testWithSameAuthor() { $expectedElement = '/p:cmAuthorLst/p:cmAuthor'; $oAuthor = new Comment\Author(); $oComment1 = new Comment(); $oComment1->setAuthor($oAuthor); $this->oPresentation->getActiveSlide()->addShape($oComment1); $oComment2 = new Comment(); $oComment2->setAuthor($oAuthor); $this->oPresentation->getActiveSlide()->addShape($oComment2); $this->assertZipFileExists('ppt/commentAuthors.xml'); $this->assertZipXmlElementExists('ppt/commentAuthors.xml', $expectedElement); $this->assertZipXmlElementCount('ppt/commentAuthors.xml', $expectedElement, 1); } }