getDefaultRating()); $team2 = new Team($player2, $gameInfo->getDefaultRating());; $teams = Teams::concat($team1, $team2); $newRatings = $calculator->calculateNewRatings($gameInfo, $teams, array(1, 2)); $player1NewRating = $newRatings->getRating($player1); self::assertRating($testClass, 29.39583201999924, 7.171475587326186, $player1NewRating); $player2NewRating = $newRatings->getRating($player2); self::assertRating($testClass, 20.60416798000076, 7.171475587326186, $player2NewRating); self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } private static function assertRating($testClass, $expectedMean, $expectedStandardDeviation, $actual) { $testClass->assertEquals($expectedMean, $actual->getMean(), '', self::ERROR_TOLERANCE_TRUESKILL); $testClass->assertEquals($expectedStandardDeviation, $actual->getStandardDeviation(), '', self::ERROR_TOLERANCE_TRUESKILL); } private static function assertMatchQuality($testClass, $expectedMatchQuality, $actualMatchQuality) { $testClass->assertEquals($expectedMatchQuality, $actualMatchQuality, '', self::ERROR_TOLERANCE_MATCH_QUALITY); } } ?>