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

51 lines
1.6 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BesselYTest extends AllSetupTeardown
{
/**
* @dataProvider providerBESSELY
*
* @param mixed $expectedResult
*/
public function testBESSELY($expectedResult, ...$args): void
{
$this->runTestCase('BESSELY', $expectedResult, ...$args);
}
public function providerBESSELY(): array
{
return require 'tests/data/Calculation/Engineering/BESSELY.php';
}
/**
* @dataProvider providerBesselYArray
*/
public function testBesselYArray(array $expectedResult, string $value, string $ord): void
{
$calculation = Calculation::getInstance();
$formula = "=BESSELY({$value}, {$ord})";
$result = $calculation->_calculateFormulaValue($formula);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-14);
}
public function providerBesselYArray(): array
{
return [
'row/column vector' => [
[
[-3.005455650891885, -0.9315730314941618, -0.44451873376270784, 0.25821685699105446, 0.4980703584466886],
[-63.67859624529592, -2.7041052277866418, -1.4714723918672943, -0.5843640364184131, 0.14591813750831284],
[-12732.713793408293, -20.701268790798974, -5.441370833706469, -1.1931993152605154, -0.3813358484400383],
],
'{0.01, 0.25, 0.5, 1.25, 2.5}',
'{0; 1; 2}',
],
];
}
}