mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-10-31 08:22:30 +01:00 
			
		
		
		
	
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
			
				
	
	
		
			36 lines
		
	
	
		
			986 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			986 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| declare(strict_types=1);
 | |
| 
 | |
| namespace DNW\Skills\Tests;
 | |
| 
 | |
| use DNW\Skills\Guard;
 | |
| use Exception;
 | |
| use PHPUnit\Framework\TestCase;
 | |
| use PHPUnit\Framework\Attributes\CoversClass;
 | |
| 
 | |
| #[CoversClass(Guard::class)]
 | |
| class GuardTest extends TestCase
 | |
| {
 | |
|     public function testargumentIsValidIndex(): void
 | |
|     {
 | |
|         $this->expectException(Exception::class);
 | |
|         $this->expectExceptionMessage('dummy is an invalid index');
 | |
|         Guard::argumentIsValidIndex(10, 10, "dummy");
 | |
|     }
 | |
| 
 | |
|     public function testargumentIsValidIndex2(): void
 | |
|     {
 | |
|         $this->expectException(Exception::class);
 | |
|         $this->expectExceptionMessage('dummy is an invalid index');
 | |
|         Guard::argumentIsValidIndex(-1, 10, "dummy");
 | |
|     }
 | |
| 
 | |
|     public function testargumentInRangeInclusive(): void
 | |
|     {
 | |
|         $this->expectException(Exception::class);
 | |
|         $this->expectExceptionMessage('dummy is not in the valid range [0, 100]');
 | |
|         Guard::argumentInRangeInclusive(101, 0, 100, "dummy");
 | |
|     }
 | |
| }
 |