diff --git a/Tests/Functional/Controller/Fixtures/Database/ContentElementTeaIndex.csv b/Tests/Functional/Controller/Fixtures/Database/ContentElementTeaIndex.csv index 0fe9c691..39af4b1b 100644 --- a/Tests/Functional/Controller/Fixtures/Database/ContentElementTeaIndex.csv +++ b/Tests/Functional/Controller/Fixtures/Database/ContentElementTeaIndex.csv @@ -1,3 +1,4 @@ "tt_content" ,"uid","pid","CType","header","list_type" ,1,1,"list","Tea index","tea_teaindex" +,2,3,"list","Tea show","tea_teashow" diff --git a/Tests/Functional/Controller/Fixtures/Database/SiteStructure.csv b/Tests/Functional/Controller/Fixtures/Database/SiteStructure.csv index f664e492..ce6f70ab 100644 --- a/Tests/Functional/Controller/Fixtures/Database/SiteStructure.csv +++ b/Tests/Functional/Controller/Fixtures/Database/SiteStructure.csv @@ -2,3 +2,4 @@ ,"uid","pid","title","slug" ,1,0,"Rootpage","/" ,2,1,"Storage","/storage" +,3,1,"Show","/show" diff --git a/Tests/Functional/Controller/TeaControllerTest.php b/Tests/Functional/Controller/TeaControllerTest.php index e4c1334a..f55df849 100644 --- a/Tests/Functional/Controller/TeaControllerTest.php +++ b/Tests/Functional/Controller/TeaControllerTest.php @@ -20,6 +20,14 @@ final class TeaControllerTest extends FunctionalTestCase 'typo3conf/ext/tea/Tests/Functional/Controller/Fixtures/Sites/' => 'typo3conf/sites', ]; + protected array $configurationToUseInTestInstance = [ + 'FE' => [ + 'cacheHash' => [ + 'enforceValidation' => false, + ], + ], + ]; + protected function setUp(): void { parent::setUp(); @@ -37,6 +45,8 @@ protected function setUp(): void 'EXT:tea/Tests/Functional/Controller/Fixtures/TypoScript/Setup/Rendering.typoscript', ], ]); + $this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ContentElementTeaIndex.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/Database/Teas.csv'); } /** @@ -44,9 +54,6 @@ protected function setUp(): void */ public function indexActionRendersAllAvailableTeas(): void { - $this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ContentElementTeaIndex.csv'); - $this->importCSVDataSet(__DIR__ . '/Fixtures/Database/Teas.csv'); - $request = (new InternalRequest())->withPageId(1); $html = (string)$this->executeFrontendSubRequest($request)->getBody(); @@ -54,4 +61,17 @@ public function indexActionRendersAllAvailableTeas(): void self::assertStringContainsString('Godesberger Burgtee', $html); self::assertStringContainsString('Oolong', $html); } + + /** + * @test + */ + public function showActionRendersTheGivenTeas(): void + { + $request = (new InternalRequest())->withPageId(3)->withQueryParameters(['tx_tea_teashow[tea]' => 1]); + + $html = (string)$this->executeFrontendSubRequest($request)->getBody(); + + self::assertStringContainsString('Godesberger Burgtee', $html); + self::assertStringNotContainsString('Oolong', $html); + } }