Merge ba1d66086d into 91f756be0b
This commit is contained in:
16 files changed
+392
-3
No files matched your search
@@ -306,6 +306,24 @@ class WriterWithStyleTest extends TestCase
|
||||
$this->assertFirstChildHasAttributeEquals(CellAlignment::RIGHT, $xfElement, 'alignment', 'horizontal');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAddRowShouldApplyShrinkToFit()
|
||||
{
|
||||
$fileName = 'test_add_row_should_apply_shrink_to_fit.xlsx';
|
||||
|
||||
$shrinkToFitStyle = (new StyleBuilder())->setShouldShrinkToFit()->build();
|
||||
$dataRows = $this->createStyledRowsFromValues([['xlsx--11']], $shrinkToFitStyle);
|
||||
|
||||
$this->writeToXLSXFile($dataRows, $fileName);
|
||||
|
||||
$cellXfsDomElement = $this->getXmlSectionFromStylesXmlFile($fileName, 'cellXfs');
|
||||
$xfElement = $cellXfsDomElement->getElementsByTagName('xf')->item(1);
|
||||
$this->assertEquals(1, $xfElement->getAttribute('applyAlignment'));
|
||||
$this->assertFirstChildHasAttributeEquals('true', $xfElement, 'alignment', 'shrinkToFit');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user