load($filename); } public function testFreezePane() { $filename = tempnam(File::sysGetTempDir(), 'phpspreadsheet'); $cellSplit = 'B2'; $topLeftCell = 'E5'; $spreadsheet = new Spreadsheet(); $active = $spreadsheet->getActiveSheet(); $active->freezePane($cellSplit, $topLeftCell); $writer = new WriterXlsx($spreadsheet); $writer->save($filename); // Read written file $reader = new ReaderXlsx(); $reloadedSpreadsheet = $reader->load($filename); $reloadedActive = $reloadedSpreadsheet->getActiveSheet(); $actualCellSplit = $reloadedActive->getFreezePane(); $actualTopLeftCell = $reloadedActive->getTopLeftCell(); self::assertSame($cellSplit, $actualCellSplit, 'should be able to set freeze pane'); self::assertSame($topLeftCell, $actualTopLeftCell, 'should be able to set the top left cell'); } }