Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/PhpWordTests/Element/CellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use BadMethodCallException;
use PhpOffice\PhpWord\Element\Cell;
use PhpOffice\PhpWord\Style\Cell as CellStyle;
use PhpOffice\PhpWordTests\AbstractWebServerEmbedded;

/**
Expand Down Expand Up @@ -51,6 +52,20 @@ public function testConstructWithStyleArray(): void
self::assertNull($oCell->getWidth());
}

/**
* New instance with array.
*/
public function testConstructWithStyleObject(): void
{
$oStyle = (new CellStyle())->setWidth(17);
$oCell = new Cell(null, $oStyle);

self::assertNotNull($oCell->getStyle());
self::assertInstanceOf(CellStyle::class, $oCell->getStyle());
self::assertSame($oStyle, $oCell->getStyle());
self::assertEquals(17, $oCell->getWidth());
}

/**
* Add text.
*/
Expand Down
Loading