getActiveSheet(); $sheet->setCellValue('A1', 'Hello World !'); $sheet->getColumnDimension('A')->setWidth(20); $this->assertColumn($spreadsheet); $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); $this->assertColumn($reloadedSpreadsheet); } private function assertColumn(Spreadsheet $spreadsheet): void { $sheet = $spreadsheet->getActiveSheet(); $columnDimensions = $sheet->getColumnDimensions(); self::assertArrayHasKey('A', $columnDimensions); $column = array_shift($columnDimensions); self::assertEquals(20, $column->getWidth()); } }