Skip to content

Commit

Permalink
Added Test case for fixing PHPOffice#1455 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaval247 committed Jul 14, 2020
1 parent 782d07e commit 1f66275
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/PhpSpreadsheetTests/Reader/HtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,35 @@ public function testTextIndentUseRowspan()
self::assertEquals(10, $style->getAlignment()->getIndent());
unlink($filename);
}

public function testBorderWithRowspanAndColspan()
{
$html = '<table>
<tr>
<td style="border: 1px solid black;">NOT SPANNED</td>
<td rowspan="2" colspan="2" style="border: 1px solid black;">SPANNED</td>
</tr>
<tr>
<td style="border: 1px solid black;">NOT SPANNED</td>
</tr>
</table>';

$reader = new Html();
$spreadsheet = $reader->loadFromString($html);
$firstSheet = $spreadsheet->getSheet(0);
$style = $firstSheet->getStyle('B1:C2');

$borders = $style->getBorders();

$totalBorders = [
$borders->getTop(),
$borders->getLeft(),
$borders->getBottom(),
$borders->getRight(),
];

foreach ($totalBorders as $border) {
self::assertEquals(Border::BORDER_THIN, $border->getBorderStyle());
}
}
}

0 comments on commit 1f66275

Please sign in to comment.