mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Refactored\moved Attribut folder
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Attribut\LayerAttributInterface;
|
||||
use App\Attribut\LayerAttribut;
|
||||
use App\DBAL\Types\Meta\Right\LayerType;
|
||||
use App\Exception\NoValidChoiceException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class LayerAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var LayerAttributInterface
|
||||
*/
|
||||
protected $layerAttribut;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->layerAttribut = new class() implements LayerAttributInterface {
|
||||
use LayerAttribut;
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->layerAttribut->getLayer();
|
||||
}
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
foreach (LayerType::getChoices() as $enum) {
|
||||
$this->assertNull($this->layerAttribut->setLayer($enum));
|
||||
$this->assertEquals($enum, $this->layerAttribut->getLayer());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->layerAttribut->setLayer('NoneValidLayer');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user