Files
oleibman d93a303371 Fix Unintential Deprecated Calls in Tests - ENGINEERING (#3176)
* Fix Unintential Deprecated Calls in Tests - ENGINEERING

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

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* Fix Deliberate Deprecated Tests

Add annotations.

* Run Unit Tests in Spreadsheet Context

This turned up only one error, in IMSUB. The only group that still needs this is Statistical. Not sure if I will get to that quickly.
2022-11-24 07:57:41 -08:00

50 lines
1.3 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ErfTest extends AllSetupTeardown
{
const ERF_PRECISION = 1E-12;
/**
* @dataProvider providerERF
*
* @param mixed $expectedResult
*/
public function testERF($expectedResult, ...$args): void
{
$this->runTestCase('ERF', $expectedResult, ...$args);
}
public function providerERF(): array
{
return require 'tests/data/Calculation/Engineering/ERF.php';
}
/**
* @dataProvider providerErfArray
*/
public function testErfArray(array $expectedResult, string $lower, string $upper = 'NULL'): void
{
$calculation = Calculation::getInstance();
$formula = "=ERF({$lower}, {$upper})";
$result = $calculation->_calculateFormulaValue($formula);
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
public function providerErfArray(): array
{
return [
'row vector' => [
[
[-0.9103139782296353, -0.5204998778130465, 0.0, 0.2763263901682369, 0.999593047982555],
],
'{-1.2, -0.5, 0.0, 0.25, 2.5}',
],
];
}
}