infinito/application/symfony/tests/Unit/Domain/LayerManagement/LayerActionMapTest.php

36 lines
954 B
PHP
Raw Normal View History

2019-01-27 19:47:41 +01:00
<?php
namespace tests\Unit\Domain\LayerManagement;
use PHPUnit\Framework\TestCase;
use Infinito\DBAL\Types\ActionType;
use Infinito\Domain\LayerManagement\LayerActionMap;
use Infinito\DBAL\Types\Meta\Right\LayerType;
2019-01-27 19:47:41 +01:00
/**
* @author kevinfrantz
*/
class LayerActionMapTest extends TestCase
{
public function testGetLayersBySource(): void
{
foreach (ActionType::getValues() as $action) {
2019-01-27 19:47:41 +01:00
$layers = LayerActionMap::getLayers($action);
$this->assertArraySubset([LayerType::SOURCE], $layers);
}
}
public function testGetActionsBySource(): void
{
$actions = LayerActionMap::getActions(LayerType::SOURCE);
foreach (ActionType::getValues() as $action) {
2019-01-27 19:47:41 +01:00
$this->assertTrue(in_array($action, $actions));
}
}
public function testEmptyGetActionsBySource(): void
{
$this->assertEquals(0, count(LayerActionMap::getActions('blablabla')));
}
}