ChiTestTest.php 733 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
  3. use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
  4. use PHPUnit\Framework\TestCase;
  5. class ChiTestTest extends TestCase
  6. {
  7. /**
  8. * @dataProvider providerCHITEST
  9. *
  10. * @param mixed $expectedResult
  11. * @param mixed $actual
  12. * @param mixed $expected
  13. */
  14. public function testCHITEST($expectedResult, $actual, $expected): void
  15. {
  16. $result = Statistical\Distributions\ChiSquared::test($actual, $expected);
  17. self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
  18. }
  19. public function providerCHITEST(): array
  20. {
  21. return require 'tests/data/Calculation/Statistical/CHITEST.php';
  22. }
  23. }