Files
2022-09-26 16:20:11 +02:00

32 lines
838 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles;
use PHPUnit\Framework\TestCase;
class PercentileTest extends TestCase
{
protected function setUp(): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerPERCENTILE
*
* @param mixed $expectedResult
*/
public function testPERCENTILE($expectedResult, ...$args): void
{
$result = Percentiles::percentile(...$args);
self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
}
public function providerPERCENTILE(): array
{
return require 'tests/data/Calculation/Statistical/PERCENTILE.php';
}
}