From f7242f725e6e37f786425c4ab354087549076a16 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 27 Jan 2019 11:53:29 +0100 Subject: [PATCH] Implemented LayerRepositoryFactoryAttribut --- .../LayerRepositoryFactoryServiceAttribut.php | 34 ++++++++++++++++ ...ositoryFactoryServiceAttributInterface.php | 21 ++++++++++ ...erRepositoryFactoryServiceAttributTest.php | 39 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttribut.php create mode 100644 application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttributInterface.php create mode 100644 application/symfony/tests/Unit/Attribut/LayerRepositoryFactoryServiceAttributTest.php diff --git a/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttribut.php b/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttribut.php new file mode 100644 index 0000000..c731518 --- /dev/null +++ b/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttribut.php @@ -0,0 +1,34 @@ +layerRepositoryFactoryService = $layerRepositoryFactoryService; + } + + /** + * @return LayerRepositoryFactoryServiceInterface + */ + public function getLayerRepositoryFactoryService(): LayerRepositoryFactoryServiceInterface + { + return $this->layerRepositoryFactoryService; + } +} diff --git a/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttributInterface.php b/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttributInterface.php new file mode 100644 index 0000000..f90e984 --- /dev/null +++ b/application/symfony/src/Attribut/LayerRepositoryFactoryServiceAttributInterface.php @@ -0,0 +1,21 @@ +layerRepositoryFactoryServiceAttribut = new class() implements LayerRepositoryFactoryServiceAttributInterface { + use LayerRepositoryFactoryServiceAttribut; + }; + } + + public function testConstruct(): void + { + $this->expectException(\TypeError::class); + $this->layerRepositoryFactoryServiceAttribut->getLayerRepositoryFactoryService(); + } + + public function testAccessors(): void + { + $layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class); + $this->assertNull($this->layerRepositoryFactoryServiceAttribut->setLayerRepositoryFactoryService($layerRepositoryFactoryService)); + $this->assertEquals($layerRepositoryFactoryService, $this->layerRepositoryFactoryServiceAttribut->getLayerRepositoryFactoryService()); + } +}