mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-16 01:47:39 +00:00
Cleanup in tests/: adding namespaces, removing php closing tag and general code cleanup
This commit is contained in:
@ -1,9 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\Elo;
|
||||||
namespace Moserware\Skills\Elo;
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Elo/EloRating.php');
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/GameInfo.php');
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/PairwiseComparison.php');
|
|
||||||
|
|
||||||
use Moserware\Skills\GameInfo;
|
use Moserware\Skills\GameInfo;
|
||||||
use Moserware\Skills\PairwiseComparison;
|
use Moserware\Skills\PairwiseComparison;
|
||||||
@ -42,5 +37,3 @@ class EloAssert
|
|||||||
$testClass->assertEquals($player2AfterRating, $result[$player2]->getMean(), '', self::ERROR_TOLERANCE);
|
$testClass->assertEquals($player2AfterRating, $result[$player2]->getMean(), '', self::ERROR_TOLERANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\Elo;
|
||||||
namespace Moserware\Skills\Elo;
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/EloAssert.php');
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/PairwiseComparison.php');
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Elo/FideEloCalculator.php');
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Elo/FideKFactor.php');
|
|
||||||
|
|
||||||
|
use Moserware\Skills\Elo\FideEloCalculator;
|
||||||
|
use Moserware\Skills\Elo\ProvisionalFideKFactor;
|
||||||
use Moserware\Skills\PairwiseComparison;
|
use Moserware\Skills\PairwiseComparison;
|
||||||
use \PHPUnit_Framework_TestCase;
|
|
||||||
|
|
||||||
class FideEloCalculatorTest extends PHPUnit_Framework_TestCase
|
class FideEloCalculatorTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@ -35,5 +30,3 @@ class FideEloCalculatorTest extends PHPUnit_Framework_TestCase
|
|||||||
EloAssert::assertChessRating($this, $calc, 2600, 2500, PairwiseComparison::LOSE, 2593.6, 2506.4);
|
EloAssert::assertChessRating($this, $calc, 2600, 2500, PairwiseComparison::LOSE, 2593.6, 2506.4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\Numerics;
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Numerics/BasicMath.php');
|
|
||||||
|
|
||||||
|
|
||||||
class BasicMathTest extends PHPUnit_Framework_TestCase
|
class BasicMathTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
@ -12,4 +9,3 @@ class BasicMathTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(4, Moserware\Numerics\square(2));
|
$this->assertEquals(4, Moserware\Numerics\square(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
@ -1,11 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\Numerics;
|
||||||
namespace Moserware\Numerics;
|
|
||||||
|
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Numerics/GaussianDistribution.php');
|
|
||||||
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
@ -101,6 +94,3 @@ class GaussianDistributionTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(0.4330127018922193, $absDiff2, '', GaussianDistributionTest::ERROR_TOLERANCE);
|
$this->assertEquals(0.4330127018922193, $absDiff2, '', GaussianDistributionTest::ERROR_TOLERANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests;
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/Numerics/Matrix.php');
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
use Moserware\Numerics\Matrix;
|
use Moserware\Numerics\Matrix;
|
||||||
@ -188,9 +184,3 @@ class MatrixTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertTrue($identity3x3->equals($ccInverse));
|
$this->assertTrue($identity3x3->equals($ccInverse));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$testSuite = new \PHPUnit_Framework_TestSuite();
|
|
||||||
$testSuite->addTest( new MatrixTest("testInverse"));
|
|
||||||
\PHPUnit_TextUI_TestRunner::run($testSuite);
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests;
|
||||||
namespace Moserware\Skills;
|
|
||||||
|
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../Skills/RankSorter.php');
|
|
||||||
|
|
||||||
|
|
||||||
|
use Moserware\Skills\RankSorter;
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
class RankSorterTest extends PHPUnit_Framework_TestCase
|
class RankSorterTest extends PHPUnit_Framework_TestCase
|
||||||
@ -29,5 +23,3 @@ class RankSorterTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
@ -1,10 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\TrueSkill;
|
||||||
namespace Moserware\Skills\TrueSkill;
|
|
||||||
|
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/TrueSkill/DrawMargin.php');
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
@ -27,10 +21,3 @@ class DrawMarginTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($expected, $actual, '', DrawMarginTest::ERROR_TOLERANCE);
|
$this->assertEquals($expected, $actual, '', DrawMarginTest::ERROR_TOLERANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$testSuite = new \PHPUnit_Framework_TestSuite();
|
|
||||||
$testSuite->addTest( new DrawMarginTest( "testGetDrawMarginFromDrawProbability" ) );
|
|
||||||
\PHPUnit_TextUI_TestRunner::run($testSuite);
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\TrueSkill;
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/TrueSkill/FactorGraphTrueSkillCalculator.php');
|
|
||||||
require_once(dirname(__FILE__) . '/TrueSkillCalculatorTests.php');
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
use Moserware\Skills\TrueSkill\FactorGraphTrueSkillCalculator;
|
use Moserware\Skills\TrueSkill\FactorGraphTrueSkillCalculator;
|
||||||
@ -20,9 +15,3 @@ class FactorGraphTrueSkillCalculatorTest extends PHPUnit_Framework_TestCase
|
|||||||
TrueSkillCalculatorTests::testPartialPlayScenarios($this, $calculator);
|
TrueSkillCalculatorTests::testPartialPlayScenarios($this, $calculator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$testSuite = new \PHPUnit_Framework_TestSuite();
|
|
||||||
$testSuite->addTest( new FactorGraphTrueSkillCalculatorTest("testFactorGraphTrueSkillCalculator"));
|
|
||||||
|
|
||||||
\PHPUnit_TextUI_TestRunner::run($testSuite);
|
|
||||||
?>
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\TrueSkill;
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/GameInfo.php");
|
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/Player.php");
|
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/Rating.php");
|
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/Team.php");
|
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/Teams.php");
|
|
||||||
require_once(dirname(__FILE__) . "/../../Skills/SkillCalculator.php");
|
|
||||||
|
|
||||||
use Moserware\Skills\GameInfo;
|
use Moserware\Skills\GameInfo;
|
||||||
use Moserware\Skills\Player;
|
use Moserware\Skills\Player;
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\TrueSkill;
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/TrueSkill/TwoPlayerTrueSkillCalculator.php');
|
|
||||||
require_once(dirname(__FILE__) . '/TrueSkillCalculatorTests.php');
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
use Moserware\Skills\TrueSkill\TwoPlayerTrueSkillCalculator;
|
use Moserware\Skills\TrueSkill\TwoPlayerTrueSkillCalculator;
|
||||||
@ -18,9 +13,3 @@ class TwoPlayerTrueSkillCalculatorTest extends PHPUnit_Framework_TestCase
|
|||||||
TrueSkillCalculatorTests::testAllTwoPlayerScenarios($this, $calculator);
|
TrueSkillCalculatorTests::testAllTwoPlayerScenarios($this, $calculator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$testSuite = new \PHPUnit_Framework_TestSuite();
|
|
||||||
$testSuite->addTest( new TwoPlayerTrueSkillCalculatorTest("testTwoPlayerTrueSkillCalculator"));
|
|
||||||
|
|
||||||
\PHPUnit_TextUI_TestRunner::run($testSuite);
|
|
||||||
?>
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
<?php
|
<?php namespace Moserware\Skills\Tests\TrueSkill;
|
||||||
require_once 'PHPUnit/Framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once(dirname(__FILE__) . '/../../Skills/TrueSkill/TwoTeamTrueSkillCalculator.php');
|
|
||||||
require_once(dirname(__FILE__) . '/TrueSkillCalculatorTests.php');
|
|
||||||
|
|
||||||
use \PHPUnit_Framework_TestCase;
|
use \PHPUnit_Framework_TestCase;
|
||||||
use Moserware\Skills\TrueSkill\TwoTeamTrueSkillCalculator;
|
use Moserware\Skills\TrueSkill\TwoTeamTrueSkillCalculator;
|
||||||
@ -19,9 +14,3 @@ class TwoTeamTrueSkillCalculatorTest extends PHPUnit_Framework_TestCase
|
|||||||
TrueSkillCalculatorTests::testAllTwoTeamScenarios($this, $calculator);
|
TrueSkillCalculatorTests::testAllTwoTeamScenarios($this, $calculator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$testSuite = new \PHPUnit_Framework_TestSuite();
|
|
||||||
$testSuite->addTest( new TwoTeamTrueSkillCalculatorTest("testTwoTeamTrueSkillCalculator"));
|
|
||||||
|
|
||||||
\PHPUnit_TextUI_TestRunner::run($testSuite);
|
|
||||||
?>
|
|
||||||
|
Reference in New Issue
Block a user