compatibilityMode = Functions::getCompatibilityMode(); $this->spreadsheet = new Spreadsheet(); $this->sheet = $this->spreadsheet->getActiveSheet(); } protected function tearDown(): void { Functions::setCompatibilityMode($this->compatibilityMode); $this->spreadsheet->disconnectWorksheets(); $this->spreadsheet = null; $this->sheet = null; } protected static function setOpenOffice(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); } protected static function setGnumeric(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_GNUMERIC); } /** * @param mixed $expectedResult */ protected function mightHaveException($expectedResult): void { if ($expectedResult === 'exception') { $this->expectException(CalcException::class); } } }