expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalVariationCoefficient([1, 2, 3, 4, 5, 6, 7], 0); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the empirical covariance throws a ZeroDivisionException')] public function testInvalidEmpiricalCovariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalCovariance([], []); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('Different dataset sizes in the empirical covariance throw a InvalidDimensionException')] public function testInvalidEmpiricalCovarianceDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MeasureOfDispersion::empiricalCovariance([1, 2, 3, 4], [1, 2, 3]); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the sample variance throws a ZeroDivisionException')] public function testInvalidSampleVariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::sampleVariance([]); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the empirical/population variance throws a ZeroDivisionException')] public function testInvalidEmpiricalVariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalVariance([]); } #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidSampleCovarianceDimension() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::sampleCovariance([], []); } }