diff --git a/application/symfony/src/Entity/Attribut/ActionTypeAttribut.php b/application/symfony/src/Entity/Attribut/ActionTypeAttribut.php new file mode 100644 index 0000000..8c2829e --- /dev/null +++ b/application/symfony/src/Entity/Attribut/ActionTypeAttribut.php @@ -0,0 +1,38 @@ +actionType = $actionType; + } + + /** + * @return string + */ + public function getActionType(): string + { + return $this->actionType; + } +} diff --git a/application/symfony/src/Entity/Attribut/ActionTypeAttributInterface.php b/application/symfony/src/Entity/Attribut/ActionTypeAttributInterface.php new file mode 100644 index 0000000..3e04d8c --- /dev/null +++ b/application/symfony/src/Entity/Attribut/ActionTypeAttributInterface.php @@ -0,0 +1,27 @@ +actionTypeAttribut = new class() implements ActionTypeAttributInterface { + use ActionTypeAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->actionTypeAttribut->getActionType(); + } + + public function testAccessors(): void + { + foreach (ActionType::getChoices() as $enum) { + $this->assertNull($this->actionTypeAttribut->setActionType($enum)); + $this->assertEquals($enum, $this->actionTypeAttribut->getActionType()); + } + $this->expectException(NoValidChoiceException::class); + $this->actionTypeAttribut->setActionType('NoneValidType'); + } +}