17
17
18
18
namespace PhpOffice \PhpPresentation \Tests \Reader ;
19
19
20
+ use PhpOffice \PhpPresentation \DocumentLayout ;
20
21
use PhpOffice \PhpPresentation \Reader \PowerPoint2007 ;
21
22
use PhpOffice \PhpPresentation \Style \Alignment ;
22
23
use PhpOffice \PhpPresentation \Style \Bullet ;
@@ -83,14 +84,19 @@ public function testLoadFile01()
83
84
$ oPhpPresentation = $ object ->load ($ file );
84
85
$ this ->assertInstanceOf ('PhpOffice \\PhpPresentation \\PhpPresentation ' , $ oPhpPresentation );
85
86
// Document Properties
86
- $ this ->assertEquals ('PHPOffice ' , $ oPhpPresentation ->getProperties ()->getCreator ());
87
- $ this ->assertEquals ('PHPPresentation Team ' , $ oPhpPresentation ->getProperties ()->getLastModifiedBy ());
88
- $ this ->assertEquals ('Sample 02 Title ' , $ oPhpPresentation ->getProperties ()->getTitle ());
89
- $ this ->assertEquals ('Sample 02 Subject ' , $ oPhpPresentation ->getProperties ()->getSubject ());
90
- $ this ->assertEquals ('Sample 02 Description ' , $ oPhpPresentation ->getProperties ()->getDescription ());
91
- $ this ->assertEquals ('office 2007 openxml libreoffice odt php ' , $ oPhpPresentation ->getProperties ()->getKeywords ());
92
- $ this ->assertEquals ('Sample Category ' , $ oPhpPresentation ->getProperties ()->getCategory ());
93
- //
87
+ $ this ->assertEquals ('PHPOffice ' , $ oPhpPresentation ->getDocumentProperties ()->getCreator ());
88
+ $ this ->assertEquals ('PHPPresentation Team ' , $ oPhpPresentation ->getDocumentProperties ()->getLastModifiedBy ());
89
+ $ this ->assertEquals ('Sample 02 Title ' , $ oPhpPresentation ->getDocumentProperties ()->getTitle ());
90
+ $ this ->assertEquals ('Sample 02 Subject ' , $ oPhpPresentation ->getDocumentProperties ()->getSubject ());
91
+ $ this ->assertEquals ('Sample 02 Description ' , $ oPhpPresentation ->getDocumentProperties ()->getDescription ());
92
+ $ this ->assertEquals ('office 2007 openxml libreoffice odt php ' , $ oPhpPresentation ->getDocumentProperties ()->getKeywords ());
93
+ $ this ->assertEquals ('Sample Category ' , $ oPhpPresentation ->getDocumentProperties ()->getCategory ());
94
+ // Document Layout
95
+ $ this ->assertEquals (DocumentLayout::LAYOUT_SCREEN_4X3 , $ oPhpPresentation ->getLayout ()->getDocumentLayout ());
96
+ $ this ->assertEquals (254 , $ oPhpPresentation ->getLayout ()->getCX (DocumentLayout::UNIT_MILLIMETER ));
97
+ $ this ->assertEquals (190.5 , $ oPhpPresentation ->getLayout ()->getCY (DocumentLayout::UNIT_MILLIMETER ));
98
+
99
+ // Slides
94
100
$ this ->assertCount (4 , $ oPhpPresentation ->getAllSlides ());
95
101
96
102
// Slide 1
@@ -469,14 +475,14 @@ public function testMarkAsFinal()
469
475
$ object = new PowerPoint2007 ();
470
476
$ oPhpPresentation = $ object ->load ($ file );
471
477
$ this ->assertInstanceOf ('PhpOffice \\PhpPresentation \\PhpPresentation ' , $ oPhpPresentation );
472
- $ this ->assertFalse ($ oPhpPresentation ->isMarkedAsFinal ());
478
+ $ this ->assertFalse ($ oPhpPresentation ->getPresentationProperties ()-> isMarkedAsFinal ());
473
479
474
480
475
481
$ file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/PPTX_MarkAsFinal.pptx ' ;
476
482
$ object = new PowerPoint2007 ();
477
483
$ oPhpPresentation = $ object ->load ($ file );
478
484
$ this ->assertInstanceOf ('PhpOffice \\PhpPresentation \\PhpPresentation ' , $ oPhpPresentation );
479
- $ this ->assertTrue ($ oPhpPresentation ->isMarkedAsFinal ());
485
+ $ this ->assertTrue ($ oPhpPresentation ->getPresentationProperties ()-> isMarkedAsFinal ());
480
486
}
481
487
482
488
public function testZoom ()
@@ -485,14 +491,14 @@ public function testZoom()
485
491
$ object = new PowerPoint2007 ();
486
492
$ oPhpPresentation = $ object ->load ($ file );
487
493
$ this ->assertInstanceOf ('PhpOffice \\PhpPresentation \\PhpPresentation ' , $ oPhpPresentation );
488
- $ this ->assertEquals (1 , $ oPhpPresentation ->getZoom ());
494
+ $ this ->assertEquals (1 , $ oPhpPresentation ->getPresentationProperties ()-> getZoom ());
489
495
490
496
491
497
$ file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/PPTX_Zoom.pptx ' ;
492
498
$ object = new PowerPoint2007 ();
493
499
$ oPhpPresentation = $ object ->load ($ file );
494
500
$ this ->assertInstanceOf ('PhpOffice \\PhpPresentation \\PhpPresentation ' , $ oPhpPresentation );
495
- $ this ->assertEquals (2.68 , $ oPhpPresentation ->getZoom ());
501
+ $ this ->assertEquals (2.68 , $ oPhpPresentation ->getPresentationProperties ()-> getZoom ());
496
502
}
497
503
498
504
public function testSlideLayout ()
0 commit comments