diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/Overrides/carousel.php b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/Overrides/carousel.php new file mode 100644 index 0000000000000000000000000000000000000000..d8f4ec4e384632eeb5e0874ecaa7156eaba8b170 --- /dev/null +++ b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/Overrides/carousel.php @@ -0,0 +1,43 @@ +<?php + +// Add a Content Type called "test_carousel" +$CType = 'test_carousel'; +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( + 'tt_content', + 'CType', + [ + 'label' => 'Carousel', + 'value' => $CType, + 'icon' => 'content-carousel-item-textandimage', + 'group' => 'default', + ], + 'textmedia', + 'after' +); + +// Add a new icon +$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes'][$CType] = 'content-carousel-item-textandimage'; +// Add the "showitem" type +$GLOBALS['TCA']['tt_content']['types'][$CType] = $GLOBALS['TCA']['tt_content']['types']['header']; + +// Add a new relational field for carousel_item DB table +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( + 'tt_content', + [ + 'carousel_items' => [ + 'label' => 'Carousel Items', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'test_content_carousel_item', + 'foreign_field' => 'carousel_content_element', + ], + ], + ] +); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( + 'tt_content', + 'carousel_items', + $CType, + // after a palette or tab would be "cool" + 'after:header', +); diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/test_content_carousel_item.php b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/test_content_carousel_item.php new file mode 100644 index 0000000000000000000000000000000000000000..22f691104fd58fa9c11911ceb7cc7c71d0b19434 --- /dev/null +++ b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/test_content_carousel_item.php @@ -0,0 +1,68 @@ +<?php + +return [ + 'ctrl' => [ + 'title' => 'Carousel Item', + 'label' => 'header', + 'label_alt' => 'header_link', + 'label_alt_force' => 1, + 'default_sortby' => 'ORDER BY header', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'delete' => 'deleted', + 'languageField' => 'sys_language_uid', + 'enablecolumns' => [ + 'disabled' => 'hidden', + ], + 'security' => [ + 'ignorePageTypeRestriction' => true, + ], + 'iconfile' => 'EXT:core/Resources/Public/Icons/T3Icons/content/content-carousel.svg', + ], + 'columns' => [ + 'header' => [ + 'label' => 'Header', + 'config' => [ + 'type' => 'input', + ], + ], + 'header_link' => [ + 'label' => 'Header Link', + 'config' => [ + 'type' => 'link', + ], + ], + 'bodytext' => [ + 'label' => 'Bodytext', + 'config' => [ + 'type' => 'text', + 'enableRichtext' => true, + 'cols' => 40, + 'rows' => 15, + ], + ], + 'carousel_content_element' => [ + 'label' => 'Content Element', + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'image' => [ + 'label' => 'Image', + 'config' => [ + 'type' => 'file', + 'maxitems' => 1, + ], + ], + ], + 'types' => [ + '0' => [ + 'showitem' => 'header, header_link, bodytext, image', + ], + ], + 'palettes' => [ + 'language' => [ + 'showitem' => 'sys_language_uid, l10n_parent', + ], + ], +]; diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/composer.json b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..5276ec8641660b400ba66c418da722827d6669d4 --- /dev/null +++ b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/composer.json @@ -0,0 +1,14 @@ +{ + "name": "typo3tests/test-classic-content", + "type": "typo3-cms-extension", + "description": "This extension adds example tt_content CTypes", + "license": "GPL-2.0-or-later", + "require": { + "typo3/cms-core": "13.3.*@dev" + }, + "extra": { + "typo3/cms": { + "extension-key": "test_classic_content" + } + } +} diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/ext_emconf.php b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/ext_emconf.php new file mode 100644 index 0000000000000000000000000000000000000000..d64b732fc4bfbca7bc85920ea07e8bbab346ad0d --- /dev/null +++ b/typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/ext_emconf.php @@ -0,0 +1,21 @@ +<?php + +declare(strict_types=1); + +$EM_CONF[$_EXTKEY] = [ + 'title' => 'This extension adds example tt_content CTypes.', + 'description' => 'This extension adds example tt_content CTypes.', + 'category' => 'example', + 'version' => '13.3.0', + 'state' => 'stable', + 'author' => 'Benni Mack', + 'author_email' => 'benniYYYY@typo3.org', + 'author_company' => '', + 'constraints' => [ + 'depends' => [ + 'typo3' => '13.3.0', + ], + 'conflicts' => [], + 'suggests' => [], + ], +]; diff --git a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/ContentScenario.yaml b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/ContentScenario.yaml index dc6d1b4892c40c04d11023124ee0b4b600a81397..c3615189cce13c8aebb1dee766b3fb3be284adeb 100644 --- a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/ContentScenario.yaml +++ b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/ContentScenario.yaml @@ -33,6 +33,9 @@ entitySettings: aside: {colPos: 2} footer: {colPos: 5} flashInfo: {colPos: 10} + carousel_items: + tableName: 'test_content_carousel_item' + languageColumnNames: ['l10n_parent'] entities: page: @@ -40,8 +43,12 @@ entities: entities: content: - self: {title: 'Welcome to ACME guitars', type: *contentText, area: 'stage'} + - self: {id: 234, title: 'Our latest and greatest products', type: 'test_carousel', area: 'stage', carousel_items: '1,2'} - self: {text: '<p>Great to see you here</p>', type: *contentText, area: 'main'} - self: {text: '<p>If you read this you are at the end.</p>', type: *contentText, area: 'footer'} + carousel_items: + - self: {header: 'Meet us at Guitar Brussels in 2035', carousel_content_element: 234} + - self: {header: 'Check out our latest Hero guitars', carousel_content_element: 234} children: - self: {id: 1100, title: 'Our Products', slug: '/products', backendLayout: 'default'} entities: diff --git a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/PageContentProcessor/Partials/SingleContent.html b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/PageContentProcessor/Partials/SingleContent.html index 3b93ad1a45014b848d2016be888bf75df388040a..c4b93052867ffc4cea4d5cd2fe1763aa78552d11 100644 --- a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/PageContentProcessor/Partials/SingleContent.html +++ b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/PageContentProcessor/Partials/SingleContent.html @@ -3,4 +3,8 @@ <h3>{record.header}</h3> <p>{record.bodytext}</p> </f:case> + <f:case value="test_carousel"> + <h3>{record.header}</h3> + <p>Carousel Items will show up: {record.carousel_items}</p> + </f:case> </f:switch> diff --git a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/RecordTransform/Partials/SingleContent.html b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/RecordTransform/Partials/SingleContent.html index 3b93ad1a45014b848d2016be888bf75df388040a..c4b93052867ffc4cea4d5cd2fe1763aa78552d11 100644 --- a/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/RecordTransform/Partials/SingleContent.html +++ b/typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/RecordTransform/Partials/SingleContent.html @@ -3,4 +3,8 @@ <h3>{record.header}</h3> <p>{record.bodytext}</p> </f:case> + <f:case value="test_carousel"> + <h3>{record.header}</h3> + <p>Carousel Items will show up: {record.carousel_items}</p> + </f:case> </f:switch> diff --git a/typo3/sysext/frontend/Tests/Functional/DataProcessing/PageContentFetchingProcessorTest.php b/typo3/sysext/frontend/Tests/Functional/DataProcessing/PageContentFetchingProcessorTest.php index f1cec9890db548790448836fcb5fd8ebe25eec56..a57486f9c8bdce25c334f76abd438ac8baca0700 100644 --- a/typo3/sysext/frontend/Tests/Functional/DataProcessing/PageContentFetchingProcessorTest.php +++ b/typo3/sysext/frontend/Tests/Functional/DataProcessing/PageContentFetchingProcessorTest.php @@ -34,6 +34,10 @@ final class PageContentFetchingProcessorTest extends FunctionalTestCase 'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en-US'], ]; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content', + ]; + protected function setUp(): void { parent::setUp(); @@ -76,6 +80,7 @@ final class PageContentFetchingProcessorTest extends FunctionalTestCase $response = $this->executeFrontendSubRequest((new InternalRequest('https://acme.com/'))->withPageId(1000)); $body = (string)$response->getBody(); self::assertStringContainsString('Welcome to ACME guitars', $body); + self::assertStringContainsString('Carousel Items will show up: 2', $body); self::assertStringContainsString('Great to see you here', $body); self::assertStringContainsString('If you read this you are at the end.', $body); } diff --git a/typo3/sysext/frontend/Tests/Functional/DataProcessing/RecordTransformationProcessorTest.php b/typo3/sysext/frontend/Tests/Functional/DataProcessing/RecordTransformationProcessorTest.php index 95c60af23e88772a2ed1b563fec5779f184612cd..1f3ac93adf97bddf25863bea5068829dd680f931 100644 --- a/typo3/sysext/frontend/Tests/Functional/DataProcessing/RecordTransformationProcessorTest.php +++ b/typo3/sysext/frontend/Tests/Functional/DataProcessing/RecordTransformationProcessorTest.php @@ -30,6 +30,10 @@ final class RecordTransformationProcessorTest extends FunctionalTestCase { use SiteBasedTestTrait; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content', + ]; + protected const LANGUAGE_PRESETS = [ 'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en-US'], ];