2018-11-06 22:42:24 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Unit\Entity\Attribut;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use App\Entity\Attribut\LayerAttributInterface;
|
|
|
|
use App\Entity\Attribut\LayerAttribut;
|
2019-01-05 17:27:40 +01:00
|
|
|
use App\DBAL\Types\Meta\Right\LayerType;
|
2018-11-06 22:42:24 +01:00
|
|
|
|
|
|
|
class LayerAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var LayerAttributInterface
|
|
|
|
*/
|
|
|
|
protected $layer;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->layer = new class() implements LayerAttributInterface {
|
|
|
|
use LayerAttribut;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstruct(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->layer->getLayer();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
2019-01-05 18:06:50 +01:00
|
|
|
foreach (LayerType::getChoices() as $value) {
|
2018-11-06 22:42:24 +01:00
|
|
|
$this->assertNull($this->layer->setLayer($value));
|
|
|
|
$this->assertEquals($value, $this->layer->getLayer());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|