mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-24 03:06:11 +01:00
tea/Tests/Functional/Controller/TeaControllerTest.php
Oliver Klee 6616f79634
[TASK] Upgrade to PHPUnit 8.5 (#328)
Also upgrade to nimut/testing-framework 6.0.

This removes another blocker for running the tests with TYPO3 11LTS.

Fixes #326
2021-11-03 01:15:21 +01:00

61 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
namespace TTN\Tea\Tests\Functional\Controller;
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
/**
* @covers \TTN\Tea\Controller\TeaController
*/
class TeaControllerTest extends FunctionalTestCase
{
/**
* @var string[]
*/
protected $testExtensionsToLoad = ['typo3conf/ext/tea'];
/**
* @var string[]
*/
protected $coreExtensionsToLoad = ['fluid_styled_content'];
protected function setUp(): void
{
parent::setUp();
$this->importDataSet(__DIR__ . '/Fixtures/Database/pages.xml');
$this->importDataSet(__DIR__ . '/../Domain/Repository/Fixtures/Product/Tea.xml');
$this->setUpFrontendRootPage(
1,
[
'EXT:fluid_styled_content/Configuration/TypoScript/setup.'
. ($this->isTYPO3VersionAbove10() ? 'typoscript' : 'txt'),
'EXT:tea/Configuration/TypoScript/setup.typoscript',
'EXT:tea/Tests/Functional/Controller/Fixtures/Frontend/Basic.typoscript',
]
);
}
/**
* @test
*/
public function indexActionRendersTeaTitle(): void
{
$responseContent = $this->getFrontendResponse(1)->getContent();
$teaTitle = 'Earl Grey';
self::assertStringContainsString($teaTitle, $responseContent);
}
/**
* @return bool
*/
protected function isTYPO3VersionAbove10(): bool
{
return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 10000000;
}
}