mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 03:44:28 +00:00
Cleanup in tests/: adding namespaces, removing php closing tag and general code cleanup
This commit is contained in:
@ -1,21 +1,16 @@
|
||||
<?php
|
||||
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');
|
||||
<?php namespace Moserware\Skills\Tests\Elo;
|
||||
|
||||
use Moserware\Skills\Elo\FideEloCalculator;
|
||||
use Moserware\Skills\Elo\ProvisionalFideKFactor;
|
||||
use Moserware\Skills\PairwiseComparison;
|
||||
use \PHPUnit_Framework_TestCase;
|
||||
|
||||
|
||||
class FideEloCalculatorTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
{
|
||||
public function testFideProvisionalEloCalculator()
|
||||
{
|
||||
// verified against http://ratings.fide.com/calculator_rtd.phtml
|
||||
$calc = new FideEloCalculator(new ProvisionalFideKFactor());
|
||||
|
||||
|
||||
EloAssert::assertChessRating($this, $calc, 1200, 1500, PairwiseComparison::WIN, 1221.25, 1478.75);
|
||||
EloAssert::assertChessRating($this, $calc, 1200, 1500, PairwiseComparison::DRAW, 1208.75, 1491.25);
|
||||
EloAssert::assertChessRating($this, $calc, 1200, 1500, PairwiseComparison::LOSE, 1196.25, 1503.75);
|
||||
@ -34,6 +29,4 @@ class FideEloCalculatorTest extends PHPUnit_Framework_TestCase
|
||||
EloAssert::assertChessRating($this, $calc, 2600, 2500, PairwiseComparison::DRAW, 2598.6, 2501.4);
|
||||
EloAssert::assertChessRating($this, $calc, 2600, 2500, PairwiseComparison::LOSE, 2593.6, 2506.4);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
}
|
Reference in New Issue
Block a user