mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-26 07:58:32 +00:00
42ecc270ec
* Extract Permutation functions from the Statistical class into a dedicated Permutations class Retain the original methods in the Statistical class as stubs for BC, but deprecate them. They will be removed for PHPSpreadsheet v2 Note that unit tests still point to the Statistical class stubs; these should be modified to use the Permutations class directly when the stubs are removed Also provided a basic implementationof the PERMUTATIONA() Function
32 lines
827 B
PHP
32 lines
827 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Permutations;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class PermutationATest extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerPERMUT
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testPERMUT($expectedResult, ...$args): void
|
|
{
|
|
$result = Permutations::PERMUTATIONA(...$args);
|
|
self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
|
|
}
|
|
|
|
public function providerPERMUT()
|
|
{
|
|
return require 'tests/data/Calculation/Statistical/PERMUTATIONA.php';
|
|
}
|
|
}
|