File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tests/PhpWordTests/Writer/HTML/Element Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -179,12 +179,24 @@ public function testWriteTableCellVAlign(): void
179
179
$ cell ->addText ('bottom text ' );
180
180
$ cell ->getStyle ()->setVAlign (VerticalJc::BOTTOM );
181
181
182
+ $ cell = $ row ->addCell ();
183
+ $ cell ->addText ('no vAlign ' );
184
+ $ cell ->getStyle ()->setVAlign (VerticalJc::BOTTOM );
185
+ $ cell ->getStyle ()->setVAlign ();
186
+
182
187
$ dom = Helper::getAsHTML ($ phpWord );
183
188
$ xpath = new DOMXPath ($ dom );
184
189
185
190
$ cell1Style = Helper::getTextContent ($ xpath , '//table/tr/td[1] ' , 'style ' );
186
191
$ cell2Style = Helper::getTextContent ($ xpath , '//table/tr/td[2] ' , 'style ' );
187
192
self ::assertSame ('vertical-align: top; ' , $ cell1Style );
188
193
self ::assertSame ('vertical-align: bottom; ' , $ cell2Style );
194
+
195
+ $ cell3Query = $ xpath ->query ('//table/tr/td[3] ' );
196
+ self ::assertNotFalse ($ cell3Query );
197
+ self ::assertCount (1 , $ cell3Query );
198
+
199
+ $ cell3Style = $ cell3Query ->item (0 )->attributes ->getNamedItem ('style ' );
200
+ self ::assertNull ($ cell3Style );
189
201
}
190
202
}
You can’t perform that action at this time.
0 commit comments