Skip to content

Commit

Permalink
Merge branch 'master' into wordunimplemented2
Browse files Browse the repository at this point in the history
  • Loading branch information
oleibman authored Sep 14, 2024
2 parents 86b939f + 43785fe commit 8b01436
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes/1.x/1.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
### Miscellaneous

- 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)
- 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)

### BC Breaks
38 changes: 38 additions & 0 deletions tests/PhpWordTests/Reader/Word2007/StyleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,44 @@ public function testReadTableCellStyle(): void
self::assertEquals('auto', $styleCell->getBorderBottomColor());
}

public function testReadTableCellsWithVerticalMerge(): void
{
$documentXml = '<w:tbl>
<w:tr>
<w:tc>
<w:tcPr>
<w:vMerge w:val="restart" />
</w:tcPr>
</w:tc>
</w:tr>
<w:tr>
<w:tc>
<w:tcPr>
<w:vMerge />
</w:tcPr>
</w:tc>
</w:tr>
<w:tr>
<w:tc />
</w:tr>
</w:tbl>';

$phpWord = $this->getDocumentFromString(['document' => $documentXml]);

$table = $phpWord->getSection(0)->getElements()[0];
self::assertInstanceOf('PhpOffice\PhpWord\Element\Table', $table);

$rows = $table->getRows();
self::assertCount(3, $rows);
foreach ($rows as $row) {
self::assertCount(1, $row->getCells());
}

self::assertSame('restart', $rows[0]->getCells()[0]->getStyle()->getVMerge());
self::assertSame('continue', $rows[1]->getCells()[0]->getStyle()->getVMerge());
self::assertNull($rows[2]->getCells()[0]->getStyle()->getVMerge());
}

/**
* Test reading of position.
*/
Expand Down

0 comments on commit 8b01436

Please sign in to comment.