diff --git a/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php b/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php index 9894a59a..dac660a4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/MathTrigTest.php @@ -602,11 +602,10 @@ class MathTrigTest extends TestCase return require 'data/Calculation/MathTrig/SUBTOTALHIDDEN.php'; } - public static $cellValues; - - public function cellValues() { - echo 'CALLED cellValues()', PHP_EOL; - yield from [1,2,3,4,5,6,7,8,9,10]; + protected function cellValues($cellValues) { + return function() use ($cellValues) { + yield from $cellValues; + }; } /** @@ -616,8 +615,9 @@ class MathTrigTest extends TestCase */ public function testNestedSUBTOTAL($expectedResult, ...$args) { - self::$cellValues = Functions::flattenArray(array_slice($args, 1)); - $cellValueGenerator = $this->cellValues(); + $this->markTestSkipped('Revisite when cellValueGenarator() works for mocking getValue() calls'); + + $cellValueGenerator = $this->cellValues(Functions::flattenArray(array_slice($args, 1))); $cell = $this->getMockBuilder(Cell::class) ->setMethods(['getValue', 'isFormula'])