mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 11:17:58 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			941 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			941 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace tests\Unit\Domain\LayerManagement;
 | 
						|
 | 
						|
use PHPUnit\Framework\TestCase;
 | 
						|
use App\DBAL\Types\ActionType;
 | 
						|
use App\Domain\LayerManagement\LayerActionMap;
 | 
						|
use App\DBAL\Types\Meta\Right\LayerType;
 | 
						|
 | 
						|
/**
 | 
						|
 * @author kevinfrantz
 | 
						|
 */
 | 
						|
class LayerActionMapTest extends TestCase
 | 
						|
{
 | 
						|
    public function testGetLayersBySource(): void
 | 
						|
    {
 | 
						|
        foreach (ActionType::getChoices() as $action) {
 | 
						|
            $layers = LayerActionMap::getLayers($action);
 | 
						|
            $this->assertArraySubset([LayerType::SOURCE], $layers);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    public function testGetActionsBySource(): void
 | 
						|
    {
 | 
						|
        $actions = LayerActionMap::getActions(LayerType::SOURCE);
 | 
						|
        foreach (ActionType::getChoices() as $action) {
 | 
						|
            $this->assertTrue(in_array($action, $actions));
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    public function testEmptyGetActionsBySource(): void
 | 
						|
    {
 | 
						|
        $this->assertEquals(0, count(LayerActionMap::getActions('blablabla')));
 | 
						|
    }
 | 
						|
}
 |