Basic unit test and fix for loading data validations from xlsx file (#1063)
This commit is contained in:
parent
d4eab49815
commit
d8047b071b
|
@ -19,7 +19,7 @@ class DataValidations
|
|||
|
||||
public function load()
|
||||
{
|
||||
foreach ($this->worksheetXml->dataValidation as $dataValidation) {
|
||||
foreach ($this->worksheetXml->dataValidations->dataValidation as $dataValidation) {
|
||||
// Uppercase coordinate
|
||||
$range = strtoupper($dataValidation['sqref']);
|
||||
$rangeSet = explode(' ', $range);
|
||||
|
|
|
@ -158,6 +158,17 @@ class XlsxTest extends TestCase
|
|||
$this->assertInstanceOf(Style::class, $conditionalRule->getStyle());
|
||||
}
|
||||
|
||||
public function testLoadXlsxDataValidation()
|
||||
{
|
||||
$filename = './data/Reader/XLSX/dataValidationTest.xlsx';
|
||||
$reader = new Xlsx();
|
||||
$spreadsheet = $reader->load($filename);
|
||||
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
$this->assertTrue($worksheet->getCell('B3')->hasDataValidation());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test load Xlsx file without cell reference.
|
||||
*
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue