PptComme 934 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace PhpPresentation\Tests\Writer\PowerPoint2007;
  3. use PhpOffice\PhpPresentation\Shape\Comment;
  4. use PhpOffice\PhpPresentation\Tests\PhpPresentationTestCase;
  5. class PptCommentsTest extends PhpPresentationTestCase
  6. {
  7. protected $writerName = 'PowerPoint2007';
  8. public function testComments()
  9. {
  10. $expectedElement = '/p:cmLst/p:cm';
  11. $oAuthor = new Comment\Author();
  12. $oComment = new Comment();
  13. $oComment->setAuthor($oAuthor);
  14. $this->oPresentation->getActiveSlide()->addShape($oComment);
  15. $this->assertZipFileExists('ppt/comments/comment1.xml');
  16. $this->assertZipXmlElementExists('ppt/comments/comment1.xml', $expectedElement);
  17. $this->assertZipXmlAttributeEquals('ppt/comments/comment1.xml', $expectedElement, 'authorId', 0);
  18. }
  19. public function testWithoutComment()
  20. {
  21. $this->assertZipFileNotExists('ppt/comments/comment1.xml');
  22. }
  23. }