Skip to content

Commit

Permalink
Merge pull request #55 from FriendsOfTYPO3Headless/feature/typo3-v12-…
Browse files Browse the repository at this point in the history
…compatibility

[WIP] TYPO3 v12 compatibility
  • Loading branch information
svenpet90 authored Feb 14, 2024
2 parents f45fc4e + 1f7bbdd commit 1aefcbd
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 34 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
fail-fast: false
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
code-quality:
name: "Code quality checks"
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -60,15 +61,17 @@ jobs:
# - "ts:lint"
- "php:cs-fixer"
php-version:
- 7.4
- 8.1
- 8.2
- 8.2
tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
php-versions: [7.4, 8.0]
php-versions: [8.1, 8.2, 8.3]
typo3-versions:
- {typo3: 11, testing: 6}
- {typo3: 12, testing: 7}

name: "Run tests with PHP ${{ matrix.php-versions }}
using TYPO3 ${{ matrix.typo3-versions.typo3 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- 8.0
- 8.1
typo3-version:
- ^11.5
- ^12.4
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2.svg)

[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
[![TYPO3 11](https://img.shields.io/badge/TYPO3-11-orange.svg)](https://get.typo3.org/version/11)
[![TYPO3 12](https://img.shields.io/badge/TYPO3-12-orange.svg)](https://get.typo3.org/version/11)
[![CI Status](https://github.com/FriendsOfTYPO3Headless/headless_bootstrap_package/workflows/CI/badge.svg)](https://github.com/FriendsOfTYPO3Headless/headless_bootstrap_package/actions)
[![Code Coverage Badge](https://github.com/FriendsOfTYPO3Headless/headless_bootstrap_package/blob/code-coverage-badge/badge.svg)](https://github.com/FriendsOfTYPO3Headless/headless_bootstrap_package/blob/code-coverage-badge/clover.xml)
[![Total Downloads](http://poser.pugx.org/friendsoftypo3headless/headless-bootstrap-package/downloads)](https://packagist.org/packages/friendsoftypo3headless/headless-bootstrap-package)
Expand All @@ -28,14 +27,6 @@ This Extension requires:
- [EXT:bk2k/bootstrap-package](https://github.com/benjaminkott/bootstrap_package)
in version at least 12.0

## Compatibility

The following table shows the compatibilty of this extension to the respective EXT:bootstrap_package versions.

| | BP 13.x | BP 12.x |
|------|---------|---------|
| v2.x | ✔️ ||
| v1.x | | ✔️ |

## TYPO3 Installation

Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

abstract class BaseTest extends FunctionalTestCase
{
protected $coreExtensionsToLoad = [
protected array $coreExtensionsToLoad = [
'install',
];

protected $testExtensionsToLoad = [
protected array $testExtensionsToLoad = [
'typo3conf/ext/headless',
'typo3conf/ext/bootstrap_package',
'typo3conf/ext/headless_bootstrap_package',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/AccordionElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function checkItems(array $contentElement): void
foreach ($contentElement['content']['items'] as $item) {
self::assertArrayHasKey('id', $item);
self::assertEquals('Header', $item['header'], 'accordion item: header mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('left', $item['mediaorient'], 'accordion item: mediaorient mismatch');
self::assertEquals(2, $item['imagecols'], 'accordion item: imagecols mismatch');
self::assertEquals(0, $item['imageZoom'], 'accordion item: imageZoom mismatch');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/BaseContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function checkBackgroundImageOptions(array $contentElement, string $paral
*/
public function checkTypoLinkField(array $typolinkConfig): void
{
self::assertEquals('/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42', $typolinkConfig['href'], 'typolink href mismatch');
self::assertEquals('/page1?parameter=999&cHash=bfd4c1935d34c545ca918205373b0a42', $typolinkConfig['href'], 'typolink href mismatch');
self::assertEquals('LinkTitle', $typolinkConfig['title'], 'typolink title mismatch');
self::assertEquals('LinkClass', $typolinkConfig['class'], 'typolink class mismatch');
self::assertEquals('_blank', $typolinkConfig['target'], 'typolink target mismatch');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/CardGroupElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function checkItems(array $contentElement): void
self::assertEquals('Subheader', $item['subheader'], 'icon_set mismatch');
self::assertArrayNotHasKey('headerLayout', $item);
self::assertArrayNotHasKey('headerPosition', $item);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $item['bodytext']);

$assertConfig = $itemTestConfig[$key];

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/IconGroupElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private function checkItems(array $contentElement): void
self::assertCount(1, $contentElement['content']['items']);

foreach ($contentElement['content']['items'] as $item) {
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('Header', $item['header']);
self::assertEquals('Subheader', $item['subheader']);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/PanelElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testPanelContentElement(): void

// content element specific tests
self::assertEquals('secondary', $contentElement['content']['panelClass'], 'panelClass mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext'], 'bodytext mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext'], 'bodytext mismatch');
$this->checkDisabledFields($contentElement);

// general tests
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/TabElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private function checkItems(array $contentElement): void
foreach ($contentElement['content']['items'] as $item) {
self::assertArrayHasKey('id', $item);
self::assertEquals('Header', $item['header'], 'accordion item: header mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('left', $item['mediaorient']);
self::assertEquals(2, $item['imagecols']);
self::assertEquals(1, $item['imageZoom']);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/TextColumnElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testTextcolumnContentElement(): void
$contentElement = $fullTree['content']['colPos0'][7];

// content element specific tests
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext']);

// general tests
$this->checkDefaultContentFields($contentElement, 8, 1, 'textcolumn', 0, 'SysCategory1Title,SysCategory2Title');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/TextIconElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testTexticonContentElement(): void
$contentElement = $fullTree['content']['colPos0'][18];

// content element specific tests
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext'], 'bodytext mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext'], 'bodytext mismatch');
self::assertArrayNotHasKey('flexform', $contentElement);
$this->checkIcon($contentElement);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/TextteaserElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testTextteaserContentElement(): void
$contentElement = $fullTree['content']['colPos0'][8];

// content element specific tests
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $contentElement['content']['bodytext']);
self::assertEquals('Some teaser text', $contentElement['content']['teaser']);

// general tests
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/ContentTypes/TimelineElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private function checkItems(array $contentElement): void
self::assertArrayHasKey('id', $item);
self::assertEquals('2022-03-10 12:00:00', $item['date']);
self::assertEquals('Header', $item['header'], 'accordion item: header mismatch');
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" title="LinkTitle" target="_blank" class="LinkClass">Link</a></p>', $item['bodytext']);
self::assertEquals('<p><a href="/page1?parameter=999&amp;cHash=bfd4c1935d34c545ca918205373b0a42" target="_blank" title="LinkTitle" class="LinkClass">Link</a></p>', $item['bodytext']);

$this->checkFileReferencesField($item, 'image');
}
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"bk2k/bootstrap-package": "^13.0",
"friendsoftypo3/headless": "^3.0.3",
"typo3/cms-core": "^11.5"
"php": "^8.1",
"bk2k/bootstrap-package": "^13.0 || ^14.0",
"friendsoftypo3/headless": "^4.2",
"typo3/cms-core": "^12.4"
},
"require-dev": {
"ext-json": "*",
Expand All @@ -41,7 +41,7 @@
"phpunit/phpcov": "^8.2",
"saschaegerer/phpstan-typo3": "^1.8.2",
"typo3/coding-standards": "^0.5.0",
"typo3/testing-framework": "^6"
"typo3/testing-framework": "^7"
},
"suggest": {
"friendsoftypo3headless/headless-backendlayouts": "^1.0",
Expand Down

0 comments on commit 1aefcbd

Please sign in to comment.