mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-21 17:56:13 +01:00
Merge 951aaf0751
into de096dac50
This commit is contained in:
commit
d27d785417
3 changed files with 30 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
"tt_content"
|
||||
,"uid","pid","CType","header","list_type"
|
||||
,1,1,"list","Teas Index","tea_teaindex"
|
||||
,2,3,"list","Tea Show","tea_teashow"
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -2,3 +2,4 @@
|
|||
,"uid","pid","title","slug"
|
||||
,1,0,"Rootpage","/"
|
||||
,2,1,"Storage","/storage"
|
||||
,3,1,"Show","/show"
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace TTN\Tea\Tests\Functional\Controller;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\ArrayUtility;
|
||||
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
|
||||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
|
||||
|
||||
|
@ -22,6 +23,14 @@ final class TeaControllerTest extends FunctionalTestCase
|
|||
|
||||
protected function setUp(): void
|
||||
{
|
||||
ArrayUtility::mergeRecursiveWithOverrule($this->configurationToUseInTestInstance, [
|
||||
'FE' => [
|
||||
'cacheHash' => [
|
||||
'enforceValidation' => false,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.csv');
|
||||
|
@ -37,6 +46,8 @@ final class TeaControllerTest extends FunctionalTestCase
|
|||
'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 +55,6 @@ final class TeaControllerTest extends FunctionalTestCase
|
|||
*/
|
||||
public function indexActionRendersAllAvailableTeas(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ContentElementTeaIndex.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/Teas.csv');
|
||||
|
||||
$request = new InternalRequest();
|
||||
$request = $request->withPageId(1);
|
||||
|
||||
|
@ -55,4 +63,21 @@ final class TeaControllerTest extends FunctionalTestCase
|
|||
self::assertStringContainsString('Godesberger Burgtee', $html);
|
||||
self::assertStringContainsString('Oolong', $html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function showActionRendersTheGivenTeas(): void
|
||||
{
|
||||
$request = new InternalRequest();
|
||||
$request = $request->withPageId(3);
|
||||
$request = $request->withQueryParameters([
|
||||
'tx_tea_teashow[tea]' => 1,
|
||||
]);
|
||||
|
||||
$html = (string)$this->executeFrontendSubRequest($request)->getBody();
|
||||
|
||||
self::assertStringContainsString('Godesberger Burgtee', $html);
|
||||
self::assertStringNotContainsString('Oolong', $html);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue