mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	Unittesting
This commit is contained in:
		@@ -32,13 +32,13 @@
 | 
			
		||||
        "phplint",
 | 
			
		||||
        "phpcs"
 | 
			
		||||
    ],
 | 
			
		||||
    "static": [
 | 
			
		||||
    "analyze": [
 | 
			
		||||
        "@analyze-phpstan",
 | 
			
		||||
        "@analyze-psalm",
 | 
			
		||||
        "@analyze-rector"
 | 
			
		||||
    ],
 | 
			
		||||
    "analyze-phpstan":"vendor/bin/phpstan analyze --error-format=raw",
 | 
			
		||||
    "analyze-psalm":  "vendor/bin/psalm --no-cache",
 | 
			
		||||
    "analyze-psalm":  "vendor/bin/psalm --no-cache --show-info=true",
 | 
			
		||||
    "analyze-rector": "vendor/bin/rector --dry-run",
 | 
			
		||||
    "html": [
 | 
			
		||||
      "pandoc -s README.md -o output/README.html",
 | 
			
		||||
@@ -49,7 +49,7 @@
 | 
			
		||||
      "@document",
 | 
			
		||||
      "@benchmark",
 | 
			
		||||
      "@lint",
 | 
			
		||||
      "@static",
 | 
			
		||||
      "@analyze",
 | 
			
		||||
      "@html"
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase;
 | 
			
		||||
 | 
			
		||||
class ScheduleStepTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    public function test(): void
 | 
			
		||||
    public function testtoStringInterface(): void
 | 
			
		||||
    {
 | 
			
		||||
        $stub = $this->createStub(Factor::class);
 | 
			
		||||
        $ss = new ScheduleStep('dummy', $stub, 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase;
 | 
			
		||||
 | 
			
		||||
class VariableTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    public function test(): void
 | 
			
		||||
    public function testGetterSetter(): void
 | 
			
		||||
    {
 | 
			
		||||
        $gd_prior = new GaussianDistribution();
 | 
			
		||||
        $var      = new Variable('dummy', $gd_prior);
 | 
			
		||||
 
 | 
			
		||||
@@ -9,10 +9,11 @@ use PHPUnit\Framework\TestCase;
 | 
			
		||||
 | 
			
		||||
class PlayerTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    public function test(): void
 | 
			
		||||
    public function testPlayerObjectGetterSetter(): void
 | 
			
		||||
    {
 | 
			
		||||
        $p = new Player('dummy', 0.1, 0.2);
 | 
			
		||||
        $this->assertEquals('dummy', (string)$p);
 | 
			
		||||
        $this->assertEquals('dummy', $p->getId());
 | 
			
		||||
        $this->assertEquals(0.1, $p->getPartialPlayPercentage());
 | 
			
		||||
        $this->assertEquals(0.2, $p->getPartialUpdatePercentage());
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,6 @@ class TwoPlayerTrueSkillCalculatorTest extends TestCase
 | 
			
		||||
    {
 | 
			
		||||
        $calculator = new TwoPlayerTrueSkillCalculator();
 | 
			
		||||
 | 
			
		||||
        // We only support two players
 | 
			
		||||
        TrueSkillCalculatorTests::testAllTwoPlayerScenarios($this, $calculator);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase;
 | 
			
		||||
use PHPUnit\Framework\Attributes\CoversClass;
 | 
			
		||||
use PHPUnit\Framework\Attributes\CoversNothing;
 | 
			
		||||
 | 
			
		||||
//#[CoversClass(TwoTeamTrueSkillCalculator::class)]
 | 
			
		||||
#[CoversClass(TwoTeamTrueSkillCalculator::class)]
 | 
			
		||||
class TwoTeamTrueSkillCalculatorTest extends TestCase
 | 
			
		||||
{
 | 
			
		||||
    #[CoversNothing]
 | 
			
		||||
@@ -17,7 +17,6 @@ class TwoTeamTrueSkillCalculatorTest extends TestCase
 | 
			
		||||
    {
 | 
			
		||||
        $calculator = new TwoTeamTrueSkillCalculator();
 | 
			
		||||
 | 
			
		||||
        // We only support two players
 | 
			
		||||
        TrueSkillCalculatorTests::testAllTwoPlayerScenarios($this, $calculator);
 | 
			
		||||
        TrueSkillCalculatorTests::testAllTwoTeamScenarios($this, $calculator);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user