This commit is contained in:
Jonny Nott authored and GitHub committed 2022-05-26 15:55:27 +02:00
commit bc54327cf4
11 files changed
+229 -24

No files matched your search

@@ -271,6 +271,26 @@ class WriterWithStyleTest extends TestCase
$this->assertFirstChildHasAttributeEquals('1', $xfElement, 'alignment', 'wrapText');
}
/**
* @return void
*/
public function testAddRowShouldAddNegatedWrapTextAlignmentInfoInStylesXmlFileIfSpecified()
{
$fileName = 'test_add_row_should_add_negated_wrap_text_alignment.xlsx';
$style = (new StyleBuilder())->setShouldWrapText(false)->build();
$dataRows = $this->createStyledRowsFromValues([
['xlsx--11', 'xlsx--12'],
], $style);
$this->writeToXLSXFile($dataRows, $fileName);
$cellXfsDomElement = $this->getXmlSectionFromStylesXmlFile($fileName, 'cellXfs');
$xfElement = $cellXfsDomElement->getElementsByTagName('xf')->item(1);
$this->assertEquals(1, $xfElement->getAttribute('applyAlignment'));
$this->assertFirstChildHasAttributeEquals('0', $xfElement, 'alignment', 'wrapText');
}
/**
* @return void
*/