mirror of https://github.com/kcal-app/kcal.git
				
				
				
			
		
			
				
	
	
		
			26 lines
		
	
	
		
			510 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			510 B
		
	
	
	
		
			PHP
		
	
	
	
| <?php
 | |
| 
 | |
| 
 | |
| namespace Tests\Unit\Rules;
 | |
| 
 | |
| use App\Rules\InArray;
 | |
| 
 | |
| class InArrayTest extends RulesTestCase
 | |
| {
 | |
| 
 | |
|     /**
 | |
|      * Test in array rule.
 | |
|      *
 | |
|      * @see \App\Rules\InArray
 | |
|      */
 | |
|     public function testInArrayRule(): void
 | |
|     {
 | |
|         $this->validator->setRules([new InArray(['item'])]);
 | |
|         $this->validator->setData(['item']);
 | |
|         $this->assertTrue($this->validator->passes());
 | |
|         $this->validator->setData(['not item']);
 | |
|         $this->assertFalse($this->validator->passes());
 | |
|     }
 | |
| 
 | |
| }
 |