diff --git a/application/src/Entity/Meta/Right.php b/application/src/Entity/Meta/Right.php index 82458e9..6514bd9 100644 --- a/application/src/Entity/Meta/Right.php +++ b/application/src/Entity/Meta/Right.php @@ -16,7 +16,7 @@ use App\Entity\Attribut\LayerAttribut; use App\Entity\Attribut\RelationAttribut; use App\Entity\Attribut\PriorityAttribut; use App\Entity\Source\SourceInterface; -use App\Exception\NoValidChoice; +use App\Exception\NoValidChoiceException; /** * @author kevinfrantz @@ -100,7 +100,7 @@ class Right extends AbstractMeta implements RightInterface public function setType(string $type): void { if (!array_key_exists($type, RightType::getChoices())) { - throw new NoValidChoice(); + throw new NoValidChoiceException(); } $this->type = $type; } @@ -108,7 +108,7 @@ class Right extends AbstractMeta implements RightInterface public function setLayer(string $layer): void { if (!array_key_exists($layer, LayerType::getChoices())) { - throw new NoValidChoice(); + throw new NoValidChoiceException(); } $this->layer = $layer; } diff --git a/application/src/Exception/AllreadySetException.php b/application/src/Exception/AllreadySetException.php new file mode 100644 index 0000000..7c7ea3c --- /dev/null +++ b/application/src/Exception/AllreadySetException.php @@ -0,0 +1,9 @@ +assertNull($this->right->setType($key)); $this->assertEquals($key, $this->right->getType()); } - $this->expectException(NoValidChoice::class); + $this->expectException(NoValidChoiceException::class); $this->right->setType('NoneValidType'); } @@ -87,7 +87,7 @@ class RightTest extends TestCase $this->assertNull($this->right->setLayer($key)); $this->assertEquals($key, $this->right->getLayer()); } - $this->expectException(NoValidChoice::class); + $this->expectException(NoValidChoiceException::class); $this->right->setLayer('NoneValidLayer'); }