2019-01-27 19:47:41 +01:00
|
|
|
<?php
|
|
|
|
|
2019-05-30 16:18:10 +02:00
|
|
|
namespace tests\Unit\Domain\Layer;
|
2019-01-27 19:47:41 +01:00
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\DBAL\Types\ActionType;
|
|
|
|
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
2020-04-02 21:13:35 +02:00
|
|
|
use Infinito\Domain\Layer\LayerActionMap;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-01-27 19:47:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class LayerActionMapTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testGetLayersBySource(): void
|
|
|
|
{
|
2019-02-25 13:32:37 +01:00
|
|
|
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);
|
2019-02-25 13:32:37 +01:00
|
|
|
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')));
|
|
|
|
}
|
|
|
|
}
|