- Create unit test (#944)

- Add changelog entry for issue #700
This commit is contained in:
Michael Roth 2019-04-15 21:39:11 +02:00 committed by Mark Baker
parent ccebf0f288
commit 15abdf43ad
2 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
- Fix handling for escaped enclosures and new lines in CSV Separator Inference
- Fix MATCH an error was appearing when comparing strings against 0 (always true)
- Fix wrong calculation of highest column with specified row [#700](https://github.com/PHPOffice/PhpSpreadsheet/issues/700)
- Fix VLOOKUP
- Fix return type hint

View File

@ -114,4 +114,21 @@ class CellsTest extends TestCase
$collection->add('A1', $cell);
$collection->add('A2', $cell);
}
public function testGetHighestColumn()
{
$workbook = new Spreadsheet();
$sheet = $workbook->getActiveSheet();
$collection = $sheet->getCellCollection();
// check for empty sheet
$this->assertEquals('A', $collection->getHighestColumn());
$this->assertEquals('A', $collection->getHighestColumn(1));
// set a value and check again
$sheet->getCell('C4')->setValue(1);
$this->assertEquals('C', $collection->getHighestColumn());
$this->assertEquals('A', $collection->getHighestColumn(1));
$this->assertEquals('C', $collection->getHighestColumn(4));
}
}