Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiTestTest.php
T
Mark Baker 67fec4e3fc Implementation of the CHITEST() statistical function (#1960)
* Implementation of the CHITEST() statistical function

* A couple of additional edge case tests (rows = 1, columns = 1)
2021-03-27 22:04:05 +01:00

28 lines
726 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
use PHPUnit\Framework\TestCase;
class ChiTestTest extends TestCase
{
/**
* @dataProvider providerCHITEST
*
* @param mixed $expectedResult
* @param mixed $actual
* @param mixed $expected
*/
public function testCHITEST($expectedResult, $actual, $expected): void
{
$result = Statistical\Distributions\ChiSquared::test($actual, $expected);
self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
}
public function providerCHITEST()
{
return require 'tests/data/Calculation/Statistical/CHITEST.php';
}
}