mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	
		
			
	
	
		
			28 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			28 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								declare(strict_types=1);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace DNW\Skills\Tests;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								use DNW\Skills\PartialPlay;
							 | 
						||
| 
								 | 
							
								use DNW\Skills\Player;
							 | 
						||
| 
								 | 
							
								use DNW\Skills\Guard;
							 | 
						||
| 
								 | 
							
								use PHPUnit\Framework\TestCase;
							 | 
						||
| 
								 | 
							
								use PHPUnit\Framework\Attributes\CoversClass;
							 | 
						||
| 
								 | 
							
								use PHPUnit\Framework\Attributes\UsesClass;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#[CoversClass(PartialPlay::class)]
							 | 
						||
| 
								 | 
							
								#[UsesClass(Player::class)]
							 | 
						||
| 
								 | 
							
								#[UsesClass(Guard::class)]
							 | 
						||
| 
								 | 
							
								class PartialPlayTest extends TestCase
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    public function testgetPartialPlayPercentage(): void
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        $p = new Player(1, 0.5);
							 | 
						||
| 
								 | 
							
								        $this->assertEquals($p->getPartialPlayPercentage(), PartialPlay::getPartialPlayPercentage($p));
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        $p = new Player(1, 0.000000);
							 | 
						||
| 
								 | 
							
								        $this->assertNotEquals(0.0, PartialPlay::getPartialPlayPercentage($p));
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |