PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php

34 lines
821 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Logical;
use PHPUnit\Framework\TestCase;
class IfErrorTest extends TestCase
{
protected function setUp(): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerIFERROR
*
* @param mixed $expectedResult
* @param $value
* @param $return
*/
public function testIFERROR($expectedResult, $value, $return)
{
$result = Logical::IFERROR($value, $return);
$this->assertEquals($expectedResult, $result);
}
public function providerIFERROR()
{
return require 'tests/data/Calculation/Logical/IFERROR.php';
}
}