You are here

public function CalculationTest::testBinaryComparisonOperation in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/CalculationTest.php \CalculationTest::testBinaryComparisonOperation()

@dataProvider providerBinaryComparisonOperation

File

vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/CalculationTest.php, line 21

Class

CalculationTest

Code

public function testBinaryComparisonOperation($formula, $expectedResultExcel, $expectedResultOpenOffice) {
  PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
  $resultExcel = \PHPExcel_Calculation::getInstance()
    ->_calculateFormulaValue($formula);
  $this
    ->assertEquals($expectedResultExcel, $resultExcel, 'should be Excel compatible');
  PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE);
  $resultOpenOffice = \PHPExcel_Calculation::getInstance()
    ->_calculateFormulaValue($formula);
  $this
    ->assertEquals($expectedResultOpenOffice, $resultOpenOffice, 'should be OpenOffice compatible');
}