mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 02:02:29 +01:00 
			
		
		
		
	CodeStandards on Tests
This commit is contained in:
		@@ -8,7 +8,7 @@ use DNW\Skills\Tests\TestCase;
 | 
			
		||||
 | 
			
		||||
class GaussianDistributionTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    const ERROR_TOLERANCE = 0.000001;
 | 
			
		||||
    private const ERROR_TOLERANCE = 0.000001;
 | 
			
		||||
 | 
			
		||||
    public function testCumulativeTo(): void
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ use DNW\Skills\Numerics\Matrix;
 | 
			
		||||
use DNW\Skills\Numerics\SquareMatrix;
 | 
			
		||||
use DNW\Skills\Tests\TestCase;
 | 
			
		||||
 | 
			
		||||
// phpcs:disable PSR2.Methods.FunctionCallSignature,Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma
 | 
			
		||||
class MatrixTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    public function testTwoByTwoDeterminant(): void
 | 
			
		||||
@@ -185,3 +186,4 @@ class MatrixTest extends TestCase
 | 
			
		||||
        $this->assertTrue($identity3x3->equals($ccInverse));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
// phpcs:enable
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ use DNW\Skills\TrueSkill\DrawMargin;
 | 
			
		||||
 | 
			
		||||
class DrawMarginTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    const ERROR_TOLERANCE = 0.000001;
 | 
			
		||||
    private const ERROR_TOLERANCE = 0.000001;
 | 
			
		||||
 | 
			
		||||
    public function testGetDrawMarginFromDrawProbability(): void
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,9 +12,9 @@ use DNW\Skills\Tests\TestCase;
 | 
			
		||||
 | 
			
		||||
class TrueSkillCalculatorTests
 | 
			
		||||
{
 | 
			
		||||
    const ERROR_TOLERANCE_TRUESKILL = 0.085;
 | 
			
		||||
    private const ERROR_TOLERANCE_TRUESKILL = 0.085;
 | 
			
		||||
 | 
			
		||||
    const ERROR_TOLERANCE_MATCH_QUALITY = 0.0005;
 | 
			
		||||
    private const ERROR_TOLERANCE_MATCH_QUALITY = 0.0005;
 | 
			
		||||
 | 
			
		||||
    // These are the roll-up ones
 | 
			
		||||
 | 
			
		||||
@@ -849,14 +849,29 @@ class TrueSkillCalculatorTests
 | 
			
		||||
        $team16 = new Team($player16, $gameInfo->getDefaultRating());
 | 
			
		||||
 | 
			
		||||
        $teams = Teams::concat(
 | 
			
		||||
            $team1, $team2, $team3, $team4, $team5,
 | 
			
		||||
            $team6, $team7, $team8, $team9, $team10,
 | 
			
		||||
            $team11, $team12, $team13, $team14, $team15,
 | 
			
		||||
            $team16);
 | 
			
		||||
            $team1,
 | 
			
		||||
            $team2,
 | 
			
		||||
            $team3,
 | 
			
		||||
            $team4,
 | 
			
		||||
            $team5,
 | 
			
		||||
            $team6,
 | 
			
		||||
            $team7,
 | 
			
		||||
            $team8,
 | 
			
		||||
            $team9,
 | 
			
		||||
            $team10,
 | 
			
		||||
            $team11,
 | 
			
		||||
            $team12,
 | 
			
		||||
            $team13,
 | 
			
		||||
            $team14,
 | 
			
		||||
            $team15,
 | 
			
		||||
            $team16
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $newRatings = $calculator->calculateNewRatings(
 | 
			
		||||
            $gameInfo, $teams,
 | 
			
		||||
            [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
 | 
			
		||||
            $gameInfo,
 | 
			
		||||
            $teams,
 | 
			
		||||
            [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $player1NewRating = $newRatings->getRating($player1);
 | 
			
		||||
        self::assertRating($testClass, 40.53945776946920, 5.27581643889050, $player1NewRating);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user