/**
* check that matrix calculates correctly
*
* @dataProvider getRatings
*
* @group reviews
*/
public function testMatrixCalculation(float
$expectedScore, int
$reviewCounts, float
$total, array
$aggregation): void
{ $matrix =
new RatingMatrix($aggregation);
$expectedScore =
round($expectedScore, 4
);
$actual =
round($matrix->
getAverageRating(), 4
);
static::
assertEquals($expectedScore,
$actual, 'expected score does not match'
);
static::
assertEquals($reviewCounts,
$matrix->
getTotalReviewCount(), 'expected total review count does not match'
);
static::
assertEquals($total,
$matrix->
getPointSum(), 'expected total review points does not match'
);
} /**
* dataprovider for testMatrixCalculation
*/
public static function getRatings(): array
{ return [