assertMaxColumnAndMaxRow($spreadsheet, 1, 1); } public function testSimpleSheet(): void { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B3', 'foo'); $this->assertMaxColumnAndMaxRow($spreadsheet, 2, 3); } public function testSheetWithExtraColumnDimensions(): void { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B3', 'foo'); // Artificially expend the sheet column count without any real cells $sheet->getColumnDimension('E'); $this->assertMaxColumnAndMaxRow($spreadsheet, 2, 3); } public function testSheetWithExtraRowDimensions(): void { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B3', 'foo'); // Artificially expend the sheet row count without any real cells $sheet->getRowDimension(5); $this->assertMaxColumnAndMaxRow($spreadsheet, 2, 3); } public function testSheetWithImageBelowData(): void { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B3', 'foo'); // Add a drawing to the worksheet $drawing = new Drawing(); $drawing->setPath('foo.png', false); $drawing->setCoordinates('A5'); $drawing->setWorksheet($sheet); $this->assertMaxColumnAndMaxRow($spreadsheet, 2, 5); } public function testSheetWithImageRightOfData(): void { $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B3', 'foo'); // Add a drawing to the worksheet $drawing = new Drawing(); $drawing->setPath('foo.png', false); $drawing->setCoordinates('E1'); $drawing->setWorksheet($sheet); $this->assertMaxColumnAndMaxRow($spreadsheet, 5, 3); } private function assertMaxColumnAndMaxRow(Spreadsheet $spreadsheet, int $expectedColumnCount, int $expectedRowCount): void { $writer = new Html($spreadsheet); $html = $writer->generateHtmlAll(); $rowCount = substr_count($html, '