mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-27 16:37:22 +00:00
67fec4e3fc
* Implementation of the CHITEST() statistical function * A couple of additional edge case tests (rows = 1, columns = 1)
28 lines
726 B
PHP
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';
|
|
}
|
|
}
|