Implemented tests for LayerType

This commit is contained in:
Kevin Frantz
2018-11-06 22:42:24 +01:00
parent 0bc9ca20a9
commit b13ca37959
3 changed files with 54 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\LayerAttributInterface;
use App\Entity\Attribut\LayerAttribut;
use App\DBAL\Types\LayerType;
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
{
foreach ([
LayerType::LAW,
LayerType::RELATION,
LayerType::SOURCE,
] as $value) {
$this->assertNull($this->layer->setLayer($value));
$this->assertEquals($value, $this->layer->getLayer());
}
}
}