assertEquals($χ², $value); } /** * @test values from function * @dataProvider dataProviderForTable */ public function testChiSquaredValuesFromFunction(int $df, float $p, float $χ²) { // When $value = ChiSquared::getChiSquareValue($df, $p); // Then $this->assertEquals($χ², $value); } public function dataProviderForTable(): array { return [ [1, 0.995, 0.0000393], [1, 0.05, 3.841], [1, 0.050, 3.841], [1, 0.01, 6.635], [5, 0.05, 11.070], [5, 0.01, 15.086], ]; } /** * @test exception * @throws Exception\BadDataException */ public function testChiSquaredException() { // Given $df = 88474; $p = 0.44; // Then $this->expectException(Exception\BadDataException::class); // When ChiSquared::getChiSquareValue($df, $p); } }