diff --git a/tests/PhpWordTests/Writer/HTML/Element/TableTest.php b/tests/PhpWordTests/Writer/HTML/Element/TableTest.php index 88b12e7204..a4741b7a69 100644 --- a/tests/PhpWordTests/Writer/HTML/Element/TableTest.php +++ b/tests/PhpWordTests/Writer/HTML/Element/TableTest.php @@ -179,6 +179,11 @@ public function testWriteTableCellVAlign(): void $cell->addText('bottom text'); $cell->getStyle()->setVAlign(VerticalJc::BOTTOM); + $cell = $row->addCell(); + $cell->addText('no vAlign'); + $cell->getStyle()->setVAlign(VerticalJc::BOTTOM); + $cell->getStyle()->setVAlign(); + $dom = Helper::getAsHTML($phpWord); $xpath = new DOMXPath($dom); @@ -186,5 +191,12 @@ public function testWriteTableCellVAlign(): void $cell2Style = Helper::getTextContent($xpath, '//table/tr/td[2]', 'style'); self::assertSame('vertical-align: top;', $cell1Style); self::assertSame('vertical-align: bottom;', $cell2Style); + + $cell3Query = $xpath->query('//table/tr/td[3]'); + self::assertNotFalse($cell3Query); + self::assertCount(1, $cell3Query); + + $cell3Style = $cell3Query->item(0)->attributes->getNamedItem('style'); + self::assertNull($cell3Style); } }