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 [ 'all one, rating should be 3, review count 5 and total points 15' =>
[ 3.0, 5, 15, self::
getDatabaseMatrixAggregationArray(1, 1, 1, 1, 1
),
],
'rating should be 3, review count 12 and total points 40' =>
[ 3.33333, 12, 40, self::
getDatabaseMatrixAggregationArray(2, 1, 3, 3, 3
),
],
'all zero, rating should be 0, review count 0 and total points 0' =>
[ 0.0, 0, 0, self::
getDatabaseMatrixAggregationArray(0, 0, 0, 0, 0
),
],
'only one point rating given, rating should be 5, review count 15 and total points 75' =>
[ 5.0, 15, 75, self::
getDatabaseMatrixAggregationArray(0, 0, 0, 0, 15
),
],
'ascending numbers of floats, rating should be 4,0667, count 15, total 61' =>
[