2 declare(strict_types = 1);
23 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
24 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
36 protected function setUp():
void
40 $this->setUpBackendUserFromFixture(1);
43 $site =
new Site(
'test', 1, [
44 'identifier' =>
'test',
74 $this->subject = $this->getAccessibleMock(PageLayoutView::class, [
'dummy']);
75 $this->subject->_set(
'siteLanguages', $site->getLanguages());
83 $this->importCSVDataSet(ORIGINAL_ROOT .
'typo3/sysext/backend/Tests/Functional/View/Fixtures/LanguageSelectorScenarioDefault.csv');
85 $result = $this->subject->languageSelector(17);
89 preg_match_all(
'/<option value=.+<\/option>/', $result, $matches);
90 $resultingOptions = GeneralUtility::trimExplode(
'</option>', $matches[0][0],
true);
91 $this->assertCount(4, $resultingOptions);
93 $this->assertStringEndsWith(
'german', $resultingOptions[1]);
94 $this->assertStringEndsWith(
'french', $resultingOptions[2]);
95 $this->assertStringEndsWith(
'polish', $resultingOptions[3]);
103 $this->importCSVDataSet(ORIGINAL_ROOT .
'typo3/sysext/backend/Tests/Functional/View/Fixtures/LanguageSelectorScenarioTranslationDone.csv');
104 $result = $this->subject->languageSelector(17);
108 preg_match_all(
'/<option value=.+<\/option>/', $result, $matches);
109 $resultingOptions = GeneralUtility::trimExplode(
'</option>', $matches[0][0],
true);
110 $this->assertCount(3, $resultingOptions);
112 $this->assertStringEndsWith(
'german', $resultingOptions[1]);
113 $this->assertStringEndsWith(
'french', $resultingOptions[2]);