2018-05-27 00:28:13 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
namespace TTN\Tea\Tests\Functional\Controller;
|
2018-05-27 00:28:13 +02:00
|
|
|
|
|
|
|
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
|
2020-07-23 12:41:27 +02:00
|
|
|
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
|
2018-05-27 00:28:13 +02:00
|
|
|
|
|
|
|
/**
|
2021-09-15 02:11:15 +02:00
|
|
|
* @covers \TTN\Tea\Controller\TeaController
|
2018-05-27 00:28:13 +02:00
|
|
|
*/
|
|
|
|
class TeaControllerTest extends FunctionalTestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
protected $testExtensionsToLoad = ['typo3conf/ext/tea'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
protected $coreExtensionsToLoad = ['fluid_styled_content'];
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
protected function setUp(): void
|
2018-05-27 00:28:13 +02:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Database/pages.xml');
|
|
|
|
$this->importDataSet(__DIR__ . '/../Domain/Repository/Fixtures/Product/Tea.xml');
|
|
|
|
|
|
|
|
$this->setUpFrontendRootPage(
|
|
|
|
1,
|
|
|
|
[
|
2020-07-23 12:41:27 +02:00
|
|
|
'EXT:fluid_styled_content/Configuration/TypoScript/setup.'
|
|
|
|
. ($this->isTYPO3VersionAbove10() ? 'typoscript' : 'txt'),
|
2019-12-07 11:27:29 +01:00
|
|
|
'EXT:tea/Configuration/TypoScript/setup.typoscript',
|
2018-05-27 00:28:13 +02:00
|
|
|
'EXT:tea/Tests/Functional/Controller/Fixtures/Frontend/Basic.typoscript',
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function indexActionRendersTeaTitle(): void
|
2018-05-27 00:28:13 +02:00
|
|
|
{
|
|
|
|
$responseContent = $this->getFrontendResponse(1)->getContent();
|
|
|
|
|
|
|
|
$teaTitle = 'Earl Grey';
|
2021-11-03 01:15:21 +01:00
|
|
|
self::assertStringContainsString($teaTitle, $responseContent);
|
2018-05-27 00:28:13 +02:00
|
|
|
}
|
2020-07-23 12:41:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
protected function isTYPO3VersionAbove10(): bool
|
|
|
|
{
|
|
|
|
return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 10000000;
|
|
|
|
}
|
2018-05-27 00:28:13 +02:00
|
|
|
}
|