getMockBuilder(Cell::class) ->disableOriginalConstructor() ->getMock(); $remoteCell->method('getValue') ->will($this->returnValue($value)); $sheet = $this->getMockBuilder(Worksheet::class) ->disableOriginalConstructor() ->getMock(); $sheet->method('getCell') ->will($this->returnValue($remoteCell)); $ourCell = $this->getMockBuilder(Cell::class) ->disableOriginalConstructor() ->getMock(); $ourCell->method('getWorksheet') ->will($this->returnValue($sheet)); } $result = Functions::isFormula($value, $ourCell); self::assertEquals($expectedResult, $result, null, 1E-8); } public function providerIsFormula() { return require 'data/Calculation/Functions/ISFORMULA.php'; } }