Files
oleibman fe79f7b02c Fix Unintential Deprecated Calls in Tests - INFORMATION (#3177)
* Fix Unintential Deprecated Calls in Tests - INFORMATION

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed Some Deprecated Calls

Fix them now.
2022-11-22 07:14:19 -08:00

55 lines
1.4 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Information;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue;
use PHPUnit\Framework\TestCase;
class IsNaTest extends TestCase
{
public function testIsNaNoArgument(): void
{
$result = ErrorValue::isNa();
self::assertFalse($result);
}
/**
* @dataProvider providerIsNa
*
* @param mixed $value
*/
public function testIsNa(bool $expectedResult, $value): void
{
$result = ErrorValue::isNa($value);
self::assertEquals($expectedResult, $result);
}
public function providerIsNa(): array
{
return require 'tests/data/Calculation/Information/IS_NA.php';
}
/**
* @dataProvider providerIsNaArray
*/
public function testIsNaArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
$formula = "=ISNA({$values})";
$result = $calculation->_calculateFormulaValue($formula);
self::assertEquals($expectedResult, $result);
}
public function providerIsNaArray(): array
{
return [
'vector' => [
[[false, false, true, false, false, false]],
'{5/0, "#REF!", "#N/A", 1.2, TRUE, "PHP"}',
],
];
}
}