diff --git a/Classes/Controller/.gitkeep b/Classes/Controller/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Classes/Controller/TeaController.php b/Classes/Controller/TeaController.php new file mode 100644 index 0000000..13078f8 --- /dev/null +++ b/Classes/Controller/TeaController.php @@ -0,0 +1,37 @@ +teaRepository = $teaRepository; + } + + /** + * @return void + */ + public function indexAction() + { + $this->view->assign('teas', $this->teaRepository->findAll()); + } +} diff --git a/Configuration/FlexForms/Plugin.xml b/Configuration/FlexForms/Plugin.xml new file mode 100644 index 0000000..53f069d --- /dev/null +++ b/Configuration/FlexForms/Plugin.xml @@ -0,0 +1,35 @@ + + + + + + + + + + array + + + + + reload + + select + selectSingle + + + LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea.index + Tea->index + + + + + + + + + + diff --git a/Configuration/TCA/Overrides/.gitkeep b/Configuration/TCA/Overrides/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php new file mode 100644 index 0000000..3906beb --- /dev/null +++ b/Configuration/TCA/Overrides/tt_content.php @@ -0,0 +1,23 @@ + + + +
+ + + Tea + Tee + + + View + Ansicht + + + Tea list + Teeliste + + + Our selection of assorted teas + Unsere Auswahl an erlesenen Tees + + + + diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf new file mode 100644 index 0000000..4d8a893 --- /dev/null +++ b/Resources/Private/Language/locallang.xlf @@ -0,0 +1,20 @@ + + + +
+ + + Tea + + + View + + + Tea list + + + Our selection of assorted teas + + + + diff --git a/Resources/Private/Layouts/.gitkeep b/Resources/Private/Layouts/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html new file mode 100644 index 0000000..d2f12bd --- /dev/null +++ b/Resources/Private/Layouts/Default.html @@ -0,0 +1,5 @@ + +
+ +
+ diff --git a/Resources/Private/Templates/.gitkeep b/Resources/Private/Templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Resources/Private/Templates/Tea/Index.html b/Resources/Private/Templates/Tea/Index.html new file mode 100644 index 0000000..327b61b --- /dev/null +++ b/Resources/Private/Templates/Tea/Index.html @@ -0,0 +1,25 @@ + + + + + +

+ +

+ + + + + + + + + + +
+ {tea.uid} + + {tea.title} +
+
+ diff --git a/Tests/Unit/Controller/.gitkeep b/Tests/Unit/Controller/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Tests/Unit/Controller/TeaControllerTest.php b/Tests/Unit/Controller/TeaControllerTest.php new file mode 100644 index 0000000..6601a1c --- /dev/null +++ b/Tests/Unit/Controller/TeaControllerTest.php @@ -0,0 +1,79 @@ +subject = new TeaController(); + + $this->viewProphecy = $this->prophesize(TemplateView::class); + $this->view = $this->viewProphecy->reveal(); + $this->inject($this->subject, 'view', $this->view); + + $this->teaRepositoryProphecy = $this->prophesize(TeaRepository::class); + $this->teaRepository = $this->teaRepositoryProphecy->reveal(); + $this->subject->injectTeaRepository($this->teaRepository); + } + + /** + * @test + */ + public function isActionController() + { + static::assertInstanceOf(ActionController::class, $this->subject); + } + + /** + * @test + */ + public function indexActionAssignsAllTeaAsTeasToView() + { + $teas = $this->prophesize(QueryResultInterface::class)->reveal(); + $this->teaRepositoryProphecy->findAll()->willReturn($teas); + $this->viewProphecy->assign('teas', $teas)->shouldBeCalled(); + + $this->subject->indexAction(); + } +} diff --git a/ext_localconf.php b/ext_localconf.php new file mode 100644 index 0000000..777cb67 --- /dev/null +++ b/ext_localconf.php @@ -0,0 +1,16 @@ + 'index', + ], + // non-cacheable actions + [ + 'Tea' => '', + ] +);