@@ -53,6 +53,40 @@ public function testConstructException()
53
53
$ oSlide = new Slide ();
54
54
$ oSlide ->writeSlide ();
55
55
}
56
+
57
+ /**
58
+ * @link https://github.com/PHPOffice/PHPPowerPoint/issues/42
59
+ */
60
+ public function testAlignmentShapeAuto ()
61
+ {
62
+ $ phpPowerPoint = new PhpPowerpoint ();
63
+ $ oSlide = $ phpPowerPoint ->getActiveSlide ();
64
+ $ oShape = $ oSlide ->createRichTextShape ()->setWidth (400 )->setHeight (400 )->setOffsetX (100 )->setOffsetY (100 );
65
+ $ oShape ->createTextRun ('this text should be vertically aligned ' );
66
+ $ oShape ->getActiveParagraph ()->getAlignment ()->setVertical (Alignment::VERTICAL_AUTO );
67
+
68
+ $ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'PowerPoint2007 ' );
69
+ $ element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr ' ;
70
+ $ this ->assertTrue ($ pres ->elementExists ($ element , 'ppt/slides/slide1.xml ' ));
71
+ $ this ->assertFalse ($ pres ->attributeElementExists ($ element , 'anchor ' , 'ppt/slides/slide1.xml ' ));
72
+ }
73
+
74
+ /**
75
+ * @link https://github.com/PHPOffice/PHPPowerPoint/issues/42
76
+ */
77
+ public function testAlignmentShapeBase ()
78
+ {
79
+ $ phpPowerPoint = new PhpPowerpoint ();
80
+ $ oSlide = $ phpPowerPoint ->getActiveSlide ();
81
+ $ oShape = $ oSlide ->createRichTextShape ()->setWidth (400 )->setHeight (400 )->setOffsetX (100 )->setOffsetY (100 );
82
+ $ oShape ->createTextRun ('this text should be vertically aligned ' );
83
+ $ oShape ->getActiveParagraph ()->getAlignment ()->setVertical (Alignment::VERTICAL_BASE );
84
+
85
+ $ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'PowerPoint2007 ' );
86
+ $ element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr ' ;
87
+ $ this ->assertTrue ($ pres ->elementExists ($ element , 'ppt/slides/slide1.xml ' ));
88
+ $ this ->assertFalse ($ pres ->attributeElementExists ($ element , 'anchor ' , 'ppt/slides/slide1.xml ' ));
89
+ }
56
90
57
91
/**
58
92
* @link https://github.com/PHPOffice/PHPPowerPoint/issues/35
0 commit comments