diff --git a/application/symfony/src/Attribut/RequestAttribut.php b/application/symfony/src/Attribut/RequestAttribut.php new file mode 100644 index 0000000..6fa9b5c --- /dev/null +++ b/application/symfony/src/Attribut/RequestAttribut.php @@ -0,0 +1,34 @@ +request = $request; + } + + /** + * @return Request + */ + public function getRequest(): Request + { + return $this->request; + } +} diff --git a/application/symfony/src/Attribut/RequestAttributInterface.php b/application/symfony/src/Attribut/RequestAttributInterface.php new file mode 100644 index 0000000..1b13951 --- /dev/null +++ b/application/symfony/src/Attribut/RequestAttributInterface.php @@ -0,0 +1,21 @@ +requestAttribut = new class() implements RequestAttributInterface { + use RequestAttribut; + }; + } + + public function testConstruct(): void + { + $this->expectException(\TypeError::class); + $this->requestAttribut->getRequest(); + } + + public function testAccessors(): void + { + $request = $this->createMock(Request::class); + $this->assertNull($this->requestAttribut->setRequest($request)); + $this->assertEquals($request, $this->requestAttribut->getRequest()); + } +}