diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php index 5dc97e15..b6871905 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php @@ -12,7 +12,7 @@ class AbsTest extends AllSetupTeardown */ public function testRound($expectedResult, $number = 'omitted'): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $this->mightHaveException($expectedResult); $this->setCell('A1', $number); if ($number === 'omitted') { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php index c6372ddb..4b71a541 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php @@ -12,7 +12,7 @@ class AcosTest extends AllSetupTeardown public function testAcos($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(0.5); $sheet->getCell('A1')->setValue("=ACOS($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php index 557da135..c2116009 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php @@ -12,7 +12,7 @@ class AcoshTest extends AllSetupTeardown public function testAcosh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue('1.5'); $sheet->getCell('A1')->setValue("=ACOSH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php index d94d4dec..8aa5541f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php @@ -13,7 +13,7 @@ class AcotTest extends AllSetupTeardown public function testACOT($expectedResult, $number): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php index a065b496..173d27b5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php @@ -13,7 +13,7 @@ class AcothTest extends AllSetupTeardown public function testACOTH($expectedResult, $number): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AllSetupTeardown.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AllSetupTeardown.php index a8630727..f54ecaad 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AllSetupTeardown.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AllSetupTeardown.php @@ -17,26 +17,28 @@ class AllSetupTeardown extends TestCase private $compatibilityMode; /** - * @var Spreadsheet + * @var ?Spreadsheet */ private $spreadsheet; /** - * @var Worksheet + * @var ?Worksheet */ - protected $sheet; + private $sheet; protected function setUp(): void { $this->compatibilityMode = Functions::getCompatibilityMode(); - $this->spreadsheet = new Spreadsheet(); - $this->sheet = $this->spreadsheet->getActiveSheet(); } protected function tearDown(): void { Functions::setCompatibilityMode($this->compatibilityMode); - $this->spreadsheet->disconnectWorksheets(); + $this->sheet = null; + if ($this->spreadsheet !== null) { + $this->spreadsheet->disconnectWorksheets(); + $this->spreadsheet = null; + } } protected static function setOpenOffice(): void @@ -66,10 +68,30 @@ class AllSetupTeardown extends TestCase { if ($value !== null) { if (is_string($value) && is_numeric($value)) { - $this->sheet->getCell($cell)->setValueExplicit($value, DataType::TYPE_STRING); + $this->getSheet()->getCell($cell)->setValueExplicit($value, DataType::TYPE_STRING); } else { - $this->sheet->getCell($cell)->setValue($value); + $this->getSheet()->getCell($cell)->setValue($value); } } } + + protected function getSpreadsheet(): Spreadsheet + { + if ($this->spreadsheet !== null) { + return $this->spreadsheet; + } + $this->spreadsheet = new Spreadsheet(); + + return $this->spreadsheet; + } + + protected function getSheet(): Worksheet + { + if ($this->sheet !== null) { + return $this->sheet; + } + $this->sheet = $this->getSpreadsheet()->getActiveSheet(); + + return $this->sheet; + } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php index c9dbbcce..7921e85d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php @@ -13,7 +13,7 @@ class ArabicTest extends AllSetupTeardown public function testARABIC($expectedResult, $romanNumeral): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue($romanNumeral); $sheet->getCell('B1')->setValue('=ARABIC(A1)'); $result = $sheet->getCell('B1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php index b3612d01..73500d9a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php @@ -12,7 +12,7 @@ class AsinTest extends AllSetupTeardown public function testAsin($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(0.5); $sheet->getCell('A1')->setValue("=ASIN($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php index e8f21142..4337a394 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php @@ -12,7 +12,7 @@ class AsinhTest extends AllSetupTeardown public function testAsinh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(0.5); $sheet->getCell('A1')->setValue("=ASINH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php index a22d6ad3..dcf35ad1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php @@ -12,7 +12,7 @@ class Atan2Test extends AllSetupTeardown public function testATAN2($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(5); $sheet->getCell('A3')->setValue(6); $sheet->getCell('A1')->setValue("=ATAN2($formula)"); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php index 69f4ed53..4eefd922 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php @@ -12,7 +12,7 @@ class AtanTest extends AllSetupTeardown public function testAtan($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(5); $sheet->getCell('A1')->setValue("=ATAN($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php index 20a3e9c0..d790b526 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php @@ -12,7 +12,7 @@ class AtanhTest extends AllSetupTeardown public function testAtanh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A2')->setValue(0.8); $sheet->getCell('A1')->setValue("=ATANH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php index 8bf0f4b2..02f895cb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php @@ -15,7 +15,7 @@ class BaseTest extends AllSetupTeardown public function testBASE($expectedResult, $arg1 = 'omitted', $arg2 = 'omitted', $arg3 = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($arg1 !== null) { $sheet->getCell('A1')->setValue($arg1); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php index f4039458..8622ad62 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php @@ -13,7 +13,7 @@ class CeilingMathTest extends AllSetupTeardown public function testCEILINGMATH($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php index c859646b..f7b0cc28 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php @@ -13,7 +13,7 @@ class CeilingPreciseTest extends AllSetupTeardown public function testCEILINGPRECISE($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php index d65ac6e9..3ac38b0d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php @@ -13,7 +13,7 @@ class CeilingTest extends AllSetupTeardown public function testCEILING($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); @@ -31,7 +31,7 @@ class CeilingTest extends AllSetupTeardown public function testCEILINGGnumeric1Arg(): void { self::setGnumeric(); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=CEILING(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(6, $result, 1E-12); @@ -40,7 +40,7 @@ class CeilingTest extends AllSetupTeardown public function testCELINGOpenOffice1Arg(): void { self::setOpenOffice(); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=CEILING(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(6, $result, 1E-12); @@ -49,7 +49,7 @@ class CeilingTest extends AllSetupTeardown public function testCEILINGExcel1Arg(): void { $this->mightHaveException('exception'); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=CEILING(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(6, $result, 1E-12); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php index 45ad8b29..0bc70de1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php @@ -14,7 +14,7 @@ class CombinATest extends AllSetupTeardown public function testCOMBINA($expectedResult, $numObjs, $numInSet): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($numObjs !== null) { $sheet->getCell('A1')->setValue($numObjs); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php index 408b60fe..8680dee6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php @@ -14,7 +14,7 @@ class CombinTest extends AllSetupTeardown public function testCOMBIN($expectedResult, $numObjs, $numInSet): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($numObjs !== null) { $sheet->getCell('A1')->setValue($numObjs); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php index 5bb3427e..2024c6b2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php @@ -12,7 +12,7 @@ class CosTest extends AllSetupTeardown public function testCos($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 2); $sheet->getCell('A1')->setValue("=COS($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php index c408338f..1a87f72e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php @@ -12,7 +12,7 @@ class CoshTest extends AllSetupTeardown public function testCosh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 2); $sheet->getCell('A1')->setValue("=COSH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php index d096d0da..db9c17d1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php @@ -13,7 +13,7 @@ class CotTest extends AllSetupTeardown public function testCOT($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php index 11949c43..ed0bf13e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php @@ -13,7 +13,7 @@ class CothTest extends AllSetupTeardown public function testCOTH($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php index ea5a74bf..ff4067a7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php @@ -13,7 +13,7 @@ class CscTest extends AllSetupTeardown public function testCSC($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php index 071f7497..9f6a87e7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php @@ -13,7 +13,7 @@ class CschTest extends AllSetupTeardown public function testCSCH($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php index 10eb3b10..c931be2b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php @@ -12,7 +12,7 @@ class DegreesTest extends AllSetupTeardown */ public function testDegrees($expectedResult, $number = 'omitted'): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $this->mightHaveException($expectedResult); $this->setCell('A1', $number); if ($number === 'omitted') { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php index 12bca051..933737b4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php @@ -13,7 +13,7 @@ class EvenTest extends AllSetupTeardown public function testEVEN($expectedResult, $value): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue("=EVEN($value)"); $sheet->getCell('A2')->setValue(3.7); self::assertEquals($expectedResult, $sheet->getCell('A1')->getCalculatedValue()); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php index 70e7c650..c1c88bb1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php @@ -13,7 +13,7 @@ class ExpTest extends AllSetupTeardown public function testEXP($expectedResult, $number = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($number !== null) { $sheet->getCell('A1')->setValue($number); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php index 70f06f11..7a620655 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php @@ -13,7 +13,7 @@ class FactDoubleTest extends AllSetupTeardown public function testFACTDOUBLE($expectedResult, $value): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue($value); $sheet->getCell('B1')->setValue('=FACTDOUBLE(A1)'); $result = $sheet->getCell('B1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php index 379b382c..5dca45ff 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php @@ -13,7 +13,7 @@ class FactTest extends AllSetupTeardown public function testFACT($expectedResult, $arg1): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($arg1 !== null) { $sheet->getCell('A1')->setValue($arg1); } @@ -41,7 +41,7 @@ class FactTest extends AllSetupTeardown { $this->mightHaveException($expectedResult); self::setGnumeric(); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($arg1 !== null) { $sheet->getCell('A1')->setValue($arg1); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php index ecf4c73a..c5235569 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php @@ -13,7 +13,7 @@ class FloorMathTest extends AllSetupTeardown public function testFLOORMATH($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php index 22dd72ad..7db80d7a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php @@ -13,7 +13,7 @@ class FloorPreciseTest extends AllSetupTeardown public function testFLOORPRECISE($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php index b981b26a..a106a91d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php @@ -13,7 +13,7 @@ class FloorTest extends AllSetupTeardown public function testFLOOR($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); @@ -31,7 +31,7 @@ class FloorTest extends AllSetupTeardown public function testFLOORGnumeric1Arg(): void { self::setGnumeric(); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=FLOOR(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(5, $result, 1E-12); @@ -40,7 +40,7 @@ class FloorTest extends AllSetupTeardown public function testFLOOROpenOffice1Arg(): void { self::setOpenOffice(); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=FLOOR(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(5, $result, 1E-12); @@ -49,7 +49,7 @@ class FloorTest extends AllSetupTeardown public function testFLOORExcel1Arg(): void { $this->mightHaveException('exception'); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=FLOOR(5.1)'); $result = $sheet->getCell('A1')->getCalculatedValue(); self::assertEqualsWithDelta(5, $result, 1E-12); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php index aaa641d7..8c79e0fa 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php @@ -12,7 +12,7 @@ class GcdTest extends AllSetupTeardown public function testGCD($expectedResult, ...$args): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; foreach ($args as $arg) { ++$row; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php index 29abbf41..e121decb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php @@ -13,7 +13,7 @@ class IntTest extends AllSetupTeardown public function testINT($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php index 5d0ebb58..ec51e3a0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php @@ -11,7 +11,7 @@ class LcmTest extends AllSetupTeardown */ public function testLCM($expectedResult, ...$args): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; foreach ($args as $arg) { ++$row; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php index 3fe35a3c..991af46d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php @@ -13,7 +13,7 @@ class LnTest extends AllSetupTeardown public function testLN($expectedResult, $number = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($number !== null) { $sheet->getCell('A1')->setValue($number); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php index 61cade1d..be095c9b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php @@ -13,7 +13,7 @@ class Log10Test extends AllSetupTeardown public function testLN($expectedResult, $number = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($number !== null) { $sheet->getCell('A1')->setValue($number); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php index 8c45a840..ba1823b1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php @@ -14,7 +14,7 @@ class LogTest extends AllSetupTeardown public function testLOG($expectedResult, $number = 'omitted', $base = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($number !== null) { $sheet->getCell('A1')->setValue($number); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php index b629d466..f059ab48 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php @@ -25,7 +25,7 @@ class MInverseTest extends AllSetupTeardown public function testOnSpreadsheet(): void { // very limited ability to test this in the absence of dynamic arrays - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=MINVERSE({1,2,3})'); // not square self::assertSame('#VALUE!', $sheet->getCell('A1')->getCalculatedValue()); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php index e27922c2..7e15b94c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php @@ -25,7 +25,7 @@ class MMultTest extends AllSetupTeardown public function testOnSpreadsheet(): void { // very limited ability to test this in the absence of dynamic arrays - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('=MMULT({1,2,3}, {1,2,3})'); // incompatible dimensions self::assertSame('#VALUE!', $sheet->getCell('A1')->getCalculatedValue()); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php index e7aa0f41..80a3d4ba 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php @@ -13,7 +13,7 @@ class MRoundTest extends AllSetupTeardown public function testMROUND($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php index b2cb4bb2..ddd39616 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php @@ -13,7 +13,7 @@ class MdeTermTest extends AllSetupTeardown public function testMDETERM2($expectedResult, $matrix): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if (is_array($matrix)) { $sheet->fromArray($matrix, null, 'A1', true); $maxCol = $sheet->getHighestColumn(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php index ff35657f..2035d26f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php @@ -14,7 +14,7 @@ class ModTest extends AllSetupTeardown public function testMOD($expectedResult, $dividend = 'omitted', $divisor = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($dividend !== null) { $sheet->getCell('A1')->setValue($dividend); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php index 3fea7651..f511792a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php @@ -12,7 +12,7 @@ class MultinomialTest extends AllSetupTeardown public function testMULTINOMIAL($expectedResult, ...$args): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; $excelArg = ''; foreach ($args as $arg) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php index 37042743..4f6b0cab 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php @@ -13,7 +13,7 @@ class OddTest extends AllSetupTeardown public function testODD($expectedResult, $value): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue("=ODD($value)"); $sheet->getCell('A2')->setValue(3.7); self::assertEquals($expectedResult, $sheet->getCell('A1')->getCalculatedValue()); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php index 4d6ba7e2..179f7ea9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php @@ -14,7 +14,7 @@ class PowerTest extends AllSetupTeardown public function testPOWER($expectedResult, $base = 'omitted', $exponent = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($base !== null) { $sheet->getCell('A1')->setValue($base); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php index 4e63ae91..8ce39310 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php @@ -11,7 +11,7 @@ class ProductTest extends AllSetupTeardown */ public function testPRODUCT($expectedResult, ...$args): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; foreach ($args as $arg) { ++$row; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php index c8cd13b7..f5bced1e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php @@ -14,7 +14,7 @@ class QuotientTest extends AllSetupTeardown public function testQUOTIENT($expectedResult, $arg1 = 'omitted', $arg2 = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($arg1 !== null) { $sheet->getCell('A1')->setValue($arg1); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php index 03cceaac..82df95f4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php @@ -12,7 +12,7 @@ class RadiansTest extends AllSetupTeardown */ public function testRADIANS($expectedResult, $number = 'omitted'): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $this->mightHaveException($expectedResult); $this->setCell('A1', $number); if ($number === 'omitted') { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php index 2e1ba676..54d2c8d4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php @@ -14,7 +14,7 @@ class RandBetweenTest extends AllSetupTeardown public function testRANDBETWEEN($expectedResult, $min = 'omitted', $max = 'omitted'): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $lower = (int) $min; $upper = (int) $max; if ($min !== null) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandTest.php index e5e2e107..989c4883 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandTest.php @@ -6,7 +6,7 @@ class RandTest extends AllSetupTeardown { public function testRand(): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('B1')->setValue('=RAND()'); $result = $sheet->getCell('B1')->getCalculatedValue(); self::assertGreaterThanOrEqual(0, $result); @@ -16,7 +16,7 @@ class RandTest extends AllSetupTeardown public function testRandException(): void { $this->mightHaveException('exception'); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->getCell('B1')->setValue('=RAND(A1)'); $result = $sheet->getCell('B1')->getCalculatedValue(); self::assertEquals(0, $result); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php index 417656c0..2690c8d2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php @@ -13,7 +13,7 @@ class RomanTest extends AllSetupTeardown public function testROMAN($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A3', 49); $sheet->getCell('A1')->setValue("=ROMAN($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php index 97058102..7adc8258 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php @@ -13,7 +13,7 @@ class RoundDownTest extends AllSetupTeardown public function testRoundDown($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php index 960f4740..72f57580 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php @@ -13,7 +13,7 @@ class RoundTest extends AllSetupTeardown public function testRound($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php index f9ba44e0..b12ddec4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php @@ -13,7 +13,7 @@ class RoundUpTest extends AllSetupTeardown public function testRoundUp($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php index ad52cee2..395a2fee 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php @@ -13,7 +13,7 @@ class SecTest extends AllSetupTeardown public function testSEC($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php index 7dabf291..51b5ff6e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php @@ -13,7 +13,7 @@ class SechTest extends AllSetupTeardown public function testSECH($expectedResult, $angle): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php index 9070f60b..df7bb213 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php @@ -16,7 +16,7 @@ class SeriesSumTest extends AllSetupTeardown */ public function testSERIESSUM($expectedResult, $arg1, $arg2, $arg3, ...$args): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($arg1 !== null) { $sheet->getCell('C1')->setValue($arg1); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php index fd1a3e6c..d5f65f4a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php @@ -13,7 +13,7 @@ class SignTest extends AllSetupTeardown public function testSIGN($expectedResult, $value): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 0); $sheet->setCellValue('A4', -3.8); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php index c2d0afe5..24f6ea78 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php @@ -12,7 +12,7 @@ class SinTest extends AllSetupTeardown public function testSin($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 2); $sheet->getCell('A1')->setValue("=SIN($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php index bb680f08..d25560f5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php @@ -12,7 +12,7 @@ class SinhTest extends AllSetupTeardown public function testSinh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 2); $sheet->getCell('A1')->setValue("=SINH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php index 1a879056..8dd66f5f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php @@ -13,7 +13,7 @@ class SqrtPiTest extends AllSetupTeardown public function testSQRTPI($expectedResult, $number): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); if ($number !== null) { $sheet->getCell('A1')->setValue($number); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php index 8ce557bd..733de874 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php @@ -12,7 +12,7 @@ class SqrtTest extends AllSetupTeardown */ public function testSQRT($expectedResult, $number = 'omitted'): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $this->mightHaveException($expectedResult); $this->setCell('A1', $number); if ($number === 'omitted') { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php index 366b7993..2a54e459 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php @@ -13,7 +13,7 @@ class SubTotalTest extends AllSetupTeardown public function testSubtotal($expectedResult, $type): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->fromArray([[0], [1], [1], [2], [3], [5], [8], [13], [21], [34], [55], [89]], null, 'A1', true); $maxCol = $sheet->getHighestColumn(); $maxRow = $sheet->getHighestRow(); @@ -37,7 +37,7 @@ class SubTotalTest extends AllSetupTeardown { // Hidden columns don't affect calculation, only hidden rows $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->fromArray([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89], null, 'A1', true); $maxCol = $sheet->getHighestColumn(); $maxRow = $sheet->getHighestRow(); @@ -73,7 +73,7 @@ class SubTotalTest extends AllSetupTeardown public function testSubtotalRowHidden($expectedResult, $type): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->fromArray([[0], [1], [1], [2], [3], [5], [8], [13], [21], [34], [55], [89]], null, 'A1', true); $maxCol = $sheet->getHighestColumn(); $maxRow = $sheet->getHighestRow(); @@ -107,7 +107,7 @@ class SubTotalTest extends AllSetupTeardown public function testSubtotalNested(): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->fromArray( [ [123], diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php index ad560423..39ac9a66 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php @@ -16,7 +16,7 @@ class SumIfTest extends AllSetupTeardown if ($expectedResult === 'incomplete') { self::markTestIncomplete('Raises formula error - researching solution'); } - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->fromArray($array1, null, 'A1', true); $maxARow = count($array1); $firstArg = "A1:A$maxARow"; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php index b2cdb379..9bc197f7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php @@ -13,7 +13,7 @@ class SumProductTest extends AllSetupTeardown */ public function testSUMPRODUCT($expectedResult, ...$args): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; $arrayArg = ''; foreach ($args as $arr) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php index 162c578a..4de3f551 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php @@ -14,7 +14,7 @@ class SumSqTest extends AllSetupTeardown $this->mightHaveException($expectedResult); $maxRow = 0; $funcArg = ''; - $sheet = $this->sheet; + $sheet = $this->getSheet(); foreach ($args as $arg) { ++$maxRow; $funcArg = "A1:A$maxRow"; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php index b85f0c90..db393419 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php @@ -11,7 +11,7 @@ class SumTest extends AllSetupTeardown */ public function testSUM($expectedResult, ...$args): void { - $sheet = $this->sheet; + $sheet = $this->getSheet(); $row = 0; foreach ($args as $arg) { ++$row; diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php index 427e5c85..3fbe79bf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php @@ -14,7 +14,7 @@ class SumX2MY2Test extends AllSetupTeardown public function testSUMX2MY2($expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $maxRow = 0; $funcArg1 = ''; foreach (Functions::flattenArray($matrixData1) as $arg) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php index 100b8566..f3ba1826 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php @@ -14,7 +14,7 @@ class SumX2PY2Test extends AllSetupTeardown public function testSUMX2PY2($expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $maxRow = 0; $funcArg1 = ''; foreach (Functions::flattenArray($matrixData1) as $arg) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php index 43acd4a0..8291d34c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php @@ -14,7 +14,7 @@ class SumXMY2Test extends AllSetupTeardown public function testSUMXMY2($expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $maxRow = 0; $funcArg1 = ''; foreach (Functions::flattenArray($matrixData1) as $arg) { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php index 80dd7eff..c34a756c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php @@ -12,7 +12,7 @@ class TanTest extends AllSetupTeardown public function testTan($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1); $sheet->getCell('A1')->setValue("=TAN($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php index 9a55e9b4..d9d2741a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php @@ -12,7 +12,7 @@ class TanhTest extends AllSetupTeardown public function testTanh($expectedResult, string $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1); $sheet->getCell('A1')->setValue("=TANH($formula)"); $result = $sheet->getCell('A1')->getCalculatedValue(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php index 7d7a4b55..0430d4c0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php @@ -13,7 +13,7 @@ class TruncTest extends AllSetupTeardown public function testTRUNC($expectedResult, $formula): void { $this->mightHaveException($expectedResult); - $sheet = $this->sheet; + $sheet = $this->getSheet(); $sheet->setCellValue('A2', 1.3); $sheet->setCellValue('A3', 2.7); $sheet->setCellValue('A4', -3.8);