2019-07-26 20:21:17 +00:00
|
|
|
<?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
|
|
|
|
{
|
2020-04-27 10:28:36 +00:00
|
|
|
protected function setUp(): void
|
2019-07-26 20:21:17 +00:00
|
|
|
{
|
|
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIFERROR
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param $value
|
|
|
|
* @param $return
|
|
|
|
*/
|
2020-05-18 04:49:57 +00:00
|
|
|
public function testIFERROR($expectedResult, $value, $return): void
|
2019-07-26 20:21:17 +00:00
|
|
|
{
|
|
|
|
$result = Logical::IFERROR($value, $return);
|
2020-05-18 04:49:57 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2019-07-26 20:21:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIFERROR()
|
|
|
|
{
|
2020-05-17 09:35:55 +00:00
|
|
|
return require 'tests/data/Calculation/Logical/IFERROR.php';
|
2019-07-26 20:21:17 +00:00
|
|
|
}
|
|
|
|
}
|