Skip to content

Commit 8b01436

Browse files
authored
Merge branch 'master' into wordunimplemented2
2 parents 86b939f + 43785fe commit 8b01436

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/changes/1.x/1.4.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
### Miscellaneous
1616

1717
- Bump dompdf/dompdf from 2.0.4 to 3.0.0 by [@dependabot](https://github.com/dependabot) fixing [#2621](https://github.com/PHPOffice/PHPWord/issues/2621) in [#2666](https://github.com/PHPOffice/PHPWord/pull/2666)
18+
- Add test case to make sure vMerge defaults to 'continue' by [@SpraxDev](https://github.com/SpraxDev) in [#2677](https://github.com/PHPOffice/PHPWord/pull/2677)
1819

1920
### BC Breaks

tests/PhpWordTests/Reader/Word2007/StyleTest.php

+38
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,44 @@ public function testReadTableCellStyle(): void
165165
self::assertEquals('auto', $styleCell->getBorderBottomColor());
166166
}
167167

168+
public function testReadTableCellsWithVerticalMerge(): void
169+
{
170+
$documentXml = '<w:tbl>
171+
<w:tr>
172+
<w:tc>
173+
<w:tcPr>
174+
<w:vMerge w:val="restart" />
175+
</w:tcPr>
176+
</w:tc>
177+
</w:tr>
178+
<w:tr>
179+
<w:tc>
180+
<w:tcPr>
181+
<w:vMerge />
182+
</w:tcPr>
183+
</w:tc>
184+
</w:tr>
185+
<w:tr>
186+
<w:tc />
187+
</w:tr>
188+
</w:tbl>';
189+
190+
$phpWord = $this->getDocumentFromString(['document' => $documentXml]);
191+
192+
$table = $phpWord->getSection(0)->getElements()[0];
193+
self::assertInstanceOf('PhpOffice\PhpWord\Element\Table', $table);
194+
195+
$rows = $table->getRows();
196+
self::assertCount(3, $rows);
197+
foreach ($rows as $row) {
198+
self::assertCount(1, $row->getCells());
199+
}
200+
201+
self::assertSame('restart', $rows[0]->getCells()[0]->getStyle()->getVMerge());
202+
self::assertSame('continue', $rows[1]->getCells()[0]->getStyle()->getVMerge());
203+
self::assertNull($rows[2]->getCells()[0]->getStyle()->getVMerge());
204+
}
205+
168206
/**
169207
* Test reading of position.
170208
*/

0 commit comments

Comments
 (0)