You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passed style object to an element constructor isn't used resulting in bugs.
This is because method setNewStyle creates a new style object instead of using the given one.
Expected behavior
Passed object should set as element's style object
Steps to reproduce
<?phpnamespacePhpOffice\PhpWordTests\Element;
useBadMethodCallException;
usePhpOffice\PhpWord\Element\Cell;
usePhpOffice\PhpWord\Style\CellasCellStyle;
usePhpOffice\PhpWordTests\AbstractWebServerEmbedded;
/** * Test class for PhpOffice\PhpWord\Element\Cell. * * @runTestsInSeparateProcesses */class CellTest extends AbstractWebServerEmbedded
{
/** * New instance with object. */publicfunctiontestConstructWithStyleObject(): void
{
$oStyle = (newCellStyle())->setWidth(17);
$oCell = newCell(null, $oStyle);
self::assertNotNull($oCell->getStyle());
self::assertInstanceOf(CellStyle::class, $oCell->getStyle());
self::assertSame($oStyle, $oCell->getStyle());
self::assertEquals(17, $oCell->getWidth());
}
}
PHPWord version(s) where the bug happened
master
PHP version(s) where the bug happened
7.4
Priority
I want to crowdfund the bug fix (with @algora-io) and fund a community developer.
I want to pay the bug fix and fund a maintainer for that. (Contact @Progi1984)
The text was updated successfully, but these errors were encountered:
Describe the bug and add attachments
Passed style object to an element constructor isn't used resulting in bugs.
This is because method setNewStyle creates a new style object instead of using the given one.
Expected behavior
Passed object should set as element's style object
Steps to reproduce
PHPWord version(s) where the bug happened
master
PHP version(s) where the bug happened
7.4
Priority
The text was updated successfully, but these errors were encountered: