Add TYPO3 13 LTS Support

This commit is contained in:
Daniel Siepmann 2024-08-19 14:40:18 +02:00 committed by Daniel Siepmann
parent a2fa701396
commit c3f1d49cd0
SSH key fingerprint: SHA256:nAjx3Dpp8kuAC+S7QXj8BWmqw+KI1Miu+5e40BP3LXA
37 changed files with 945 additions and 863 deletions

View file

@ -91,6 +91,10 @@ jobs:
typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^13.4'
- php-version: '8.3'
typo3-version: '^13.4'
steps:
- uses: actions/checkout@v3
@ -103,7 +107,6 @@ jobs:
- name: Install dependencies with expected TYPO3 version
run: |-
composer require --no-interaction --prefer-dist --no-progress "typo3/cms-backend:${{ matrix.typo3-version }}" "typo3/cms-core:${{ matrix.typo3-version }}" "typo3/cms-extbase:${{ matrix.typo3-version }}" "typo3/cms-frontend:${{ matrix.typo3-version }}" "typo3/cms-fluid-styled-content:${{ matrix.typo3-version }}"
./vendor/bin/codecept build
- name: Code Quality (by PHPStan)
run: ./vendor/bin/phpstan analyse
@ -125,6 +128,12 @@ jobs:
- php-version: '8.3'
typo3-version: '^12.4'
db-version: '8'
- php-version: '8.2'
typo3-version: '^13.4'
db-version: '8'
- php-version: '8.3'
typo3-version: '^13.4'
db-version: '8'
steps:
- uses: actions/checkout@v3
@ -158,15 +167,3 @@ jobs:
export typo3DatabaseUsername="root"
export typo3DatabasePassword="root"
./vendor/bin/phpunit
tests-acceptance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run Acceptance Tests
run: nix-shell --run project-test-acceptance

View file

@ -2,6 +2,9 @@
$finder = (new PhpCsFixer\Finder())
->ignoreVCSIgnored(true)
->in(realpath(__DIR__))
->notPath([
'Classes/Domain/Import/EntityMapper/CustomAnnotationExtractor.php',
]);
;
return (new \PhpCsFixer\Config())

View file

@ -52,7 +52,7 @@ class ImportConfigurationCommand extends Command
);
}
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
Bootstrap::initializeBackendAuthentication();

View file

@ -161,10 +161,10 @@ class SaveData
private function getExistingUid(Entity $entity): int
{
$tableColumns = $this->connectionPool
$table = $this->connectionPool
->getConnectionForTable($entity->getTypo3DatabaseTableName())
->getSchemaManager()
->listTableColumns($entity->getTypo3DatabaseTableName())
->getSchemaInformation()
->introspectTable($entity->getTypo3DatabaseTableName())
;
$queryBuilder = $this->connectionPool->getQueryBuilderForTable($entity->getTypo3DatabaseTableName());
@ -175,7 +175,7 @@ class SaveData
'remote_id',
$queryBuilder->createNamedParameter($entity->getRemoteId())
));
if (isset($tableColumns['sys_language_uid'])) {
if ($table->hasColumn('sys_language_uid')) {
$queryBuilder->andWhere($queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($entity->getTypo3SystemLanguageUid())

View file

@ -228,9 +228,9 @@ class GeneralConverter implements Converter
[$entity->getManagedBy()]
)
);
$manager = $this->organisationRepository->findOneByRemoteId(
$entity->getManagedBy()->getId()
);
$manager = $this->organisationRepository->findOneBy([
'remoteId' => $entity->getManagedBy()->getId(),
]);
return $manager ? (string)$manager->getUid() : '';
}

View file

@ -25,6 +25,7 @@ namespace WerkraumMedia\ThueCat\Domain\Model\Backend;
use DateTimeImmutable;
use Exception;
use RuntimeException;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
@ -162,7 +163,13 @@ class ImportConfiguration extends AbstractEntity implements ImportConfigurationI
private function getConfigurationAsArray(): array
{
return GeneralUtility::xml2array($this->configuration);
$asArray = GeneralUtility::xml2array($this->configuration);
if (is_array($asArray) === false) {
throw new RuntimeException('Could not parse the configuration: ' . $asArray, 1729148214);
}
return $asArray;
}
/**

View file

@ -25,11 +25,7 @@ namespace WerkraumMedia\ThueCat\Domain\Repository\Backend;
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
use TYPO3\CMS\Extbase\Persistence\Repository;
use WerkraumMedia\ThueCat\Domain\Model\Backend\Organisation;
/**
* @method Organisation|null findOneByRemoteId(string $remoteId)
*/
class OrganisationRepository extends Repository
{
public function __construct(

View file

@ -25,6 +25,7 @@ namespace WerkraumMedia\ThueCat;
use TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend;
use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@ -59,22 +60,25 @@ class Extension
{
$languagePath = self::getLanguagePath() . 'locallang_tca.xlf:tt_content';
ExtensionManagementUtility::addPageTSConfig('
mod.wizards.newContentElement.wizardItems.thuecat {
header = ' . $languagePath . '.group
show = *
elements {
thuecat_tourist_attraction{
title = ' . $languagePath . '.thuecat_tourist_attraction
description = ' . $languagePath . '.thuecat_tourist_attraction.description
iconIdentifier = tt_content_thuecat_tourist_attraction
tt_content_defValues {
CType = thuecat_tourist_attraction
// TODO: typo3/cms-core:14.0 Remove this code block as CEs are auto registered.
if (version_compare(GeneralUtility::makeInstance(Typo3Version::class)->__toString(), '13.0', '<')) {
ExtensionManagementUtility::addPageTSConfig('
mod.wizards.newContentElement.wizardItems.thuecat {
header = ' . $languagePath . '.group
show = *
elements {
thuecat_tourist_attraction{
title = ' . $languagePath . '.thuecat_tourist_attraction
description = ' . $languagePath . '.thuecat_tourist_attraction.description
iconIdentifier = tt_content_thuecat_tourist_attraction
tt_content_defValues {
CType = thuecat_tourist_attraction
}
}
}
}
}
');
');
}
}
private static function addPageTypes(): void
@ -88,9 +92,12 @@ class Extension
]
);
ExtensionManagementUtility::addUserTSConfig(
"@import 'EXT:" . self::EXTENSION_KEY . "/Configuration/TSconfig/User/All.tsconfig'"
);
// TODO: typo3/cms-core:14.0 Remove this code block as Configuration/user.tsconfig will be loaded since 13.x
if (version_compare(GeneralUtility::makeInstance(Typo3Version::class)->__toString(), '13.0', '<')) {
ExtensionManagementUtility::addUserTSConfig(
"@import 'EXT:" . self::EXTENSION_KEY . '/Configuration/user.tsconfig'
);
}
}
private static function addCaching(): void

View file

@ -25,6 +25,7 @@ namespace WerkraumMedia\ThueCat\Frontend\DataProcessing;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@ -79,6 +80,11 @@ class ResolveEntities implements DataProcessorInterface
$rows = [];
foreach ($queryBuilder->executeQuery()->iterateAssociative() as $row) {
// TODO: typo3/cms-core:14.0 Remove this condition, should always be an instance now.
if (!$this->tsfe->sys_page instanceof PageRepository) {
continue;
}
$row = $this->tsfe->sys_page->getLanguageOverlay($tableName, $row);
if (is_array($row)) {
$rows[] = $row;

View file

@ -5,29 +5,24 @@
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.sheetTitle</sheetTitle>
</TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.sheetTitle</sheetTitle>
<type>array</type>
<el>
<storagePid>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.storagePid</label>
<config>
<type>input</type>
<eval>int,required</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.storagePid</label>
<config>
<type>number</type>
<required type="boolean">1</required>
</config>
</storagePid>
<containsPlaceId>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.containsPlaceId</label>
<description>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.containsPlaceId.description</description>
<config>
<type>input</type>
<eval>trim,required</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.containsPlaceId</label>
<description>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.containsPlace.containsPlaceId.description</description>
<config>
<type>input</type>
<eval>trim</eval>
<required type="boolean">1</required>
</config>
</containsPlaceId>
</el>
</ROOT>

View file

@ -5,19 +5,15 @@
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.sheetTitle</sheetTitle>
</TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.sheetTitle</sheetTitle>
<type>array</type>
<el>
<storagePid>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.storagePid</label>
<config>
<type>input</type>
<eval>int,required</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.storagePid</label>
<config>
<type>number</type>
<required type="boolean">1</required>
</config>
</storagePid>
<urls>
<title>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.urls</title>
@ -29,13 +25,12 @@
<type>array</type>
<el>
<url>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.url</label>
<config>
<type>input</type>
<eval>required,trim</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.static.url</label>
<config>
<type>input</type>
<eval>trim</eval>
<required type="boolean">1</required>
</config>
</url>
</el>
</url>

View file

@ -5,28 +5,23 @@
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.sheetTitle</sheetTitle>
</TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.sheetTitle</sheetTitle>
<type>array</type>
<el>
<storagePid>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.storagePid</label>
<config>
<type>input</type>
<eval>int,required</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.storagePid</label>
<config>
<type>number</type>
<required type="boolean">1</required>
</config>
</storagePid>
<syncScopeId>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.syncScopeId</label>
<config>
<type>input</type>
<eval>trim,required</eval>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:importConfiguration.syncScope.syncScopeId</label>
<config>
<type>input</type>
<eval>trim</eval>
<required type="boolean">1</required>
</config>
</syncScopeId>
</el>
</ROOT>

View file

@ -5,23 +5,19 @@
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:pages.tourist_attraction.sheetTitle</sheetTitle>
</TCEforms>
<sheetTitle>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:pages.tourist_attraction.sheetTitle</sheetTitle>
<type>array</type>
<el>
<touristAttraction>
<TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:pages.tourist_attraction.tourist_attraction</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<foreign_table>tx_thuecat_tourist_attraction</foreign_table>
<foreign_table_where>AND {#tx_thuecat_tourist_attraction}.{#sys_language_uid} IN (0,-1)</foreign_table_where>
<minitems>1</minitems>
<maxitems>1</maxitems>
</config>
</TCEforms>
<label>LLL:EXT:thuecat/Resources/Private/Language/locallang_flexform.xlf:pages.tourist_attraction.tourist_attraction</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<foreign_table>tx_thuecat_tourist_attraction</foreign_table>
<foreign_table_where>AND {#tx_thuecat_tourist_attraction}.{#sys_language_uid} IN (0,-1)</foreign_table_where>
<minitems>1</minitems>
<maxitems>1</maxitems>
</config>
</touristAttraction>
</el>
</ROOT>

View file

@ -25,7 +25,7 @@ defined('TYPO3') or die();
'type' => 'flex',
'ds_pointerField' => 'doktype',
'ds' => [
'default' => '<T3DataStructure> <ROOT> <type>array</type> <el> <!-- Repeat an element like "xmlTitle" beneath for as many elements you like. Remember to name them uniquely --> <xmlTitle> <TCEforms> <label>The Title:</label> <config> <type>input</type> <size>48</size> </config> </TCEforms> </xmlTitle> </el> </ROOT> </T3DataStructure>',
'default' => '<T3DataStructure> <ROOT> <type>array</type> <el> <!-- Repeat an element like "xmlTitle" beneath for as many elements you like. Remember to name them uniquely --> <xmlTitle> <label>The Title:</label> <config> <type>input</type> <size>48</size> </config> </xmlTitle> </el> </ROOT> </T3DataStructure>',
],
],
],

View file

@ -56,6 +56,20 @@ return (static function (string $extensionKey, string $tableName) {
'type' => 'passthrough',
],
],
'disable' => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.enabled',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'default' => 0,
'items' => [
[
'label' => '',
'invertStateDisplay' => true,
],
],
],
],
'title' => [
'label' => $languagePath . '.title',

View file

@ -0,0 +1,28 @@
3.1.0
=====
Breaking
--------
Nothing
Features
--------
* Add TYPO3 v13 LTS Support.
Fixes
-----
Nothing
Tasks
-----
Nothing
Deprecation
-----------
Nothing

View file

@ -20,4 +20,5 @@ Table of Contents
Configuration
Integration
Changelog
Maintenance
Sitemap

View file

@ -1,52 +0,0 @@
[general]
# .................................................................................
# ... (required) title (displayed in left sidebar (desktop) or top panel (mobile)
# .................................................................................
project = TYPO3 EXT:thuecat
# .................................................................................
# ... (recommended) version, displayed next to title (desktop) and in <meta name="book-version"
# .................................................................................
release = latest
# .................................................................................
# ... (recommended) displayed in footer
# .................................................................................
copyright = 2020 by werkraum-media
[html_theme_options]
# .................................................................................
# ... (recommended) to get the "Edit me on Github Button"
# .................................................................................
github_branch = main
github_repository = werkraum-media/thuecat
# usually an email address
project_contact = coding@daniel-siepmann.de
# URL of online discussions, you can leave this blank
project_discussions =
# URL of webpage of your extension (if it has one)
project_home = https://github.com/werkraum-media/thuecat
# URL to Issues
project_issues = https://github.com/werkraum-media/thuecat/issues
# URL of repository
project_repository = https://github.com/werkraum-media/thuecat
[intersphinx_mapping]
# .................................................................................
# for cross-referencing across manuals (intersphinx) with :ref:
# You must uncomment all manuals you use in your cross-references
#
# Example usage:
# :ref:`t3contribute:start` will link to start page of Contribution Guide
# .................................................................................
t3install = https://docs.typo3.org/m/typo3/guide-installation/main/en-us/
t3gettingstarted = https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/
t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/

35
Documentation/guides.xml Normal file
View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<guides
xmlns="https://www.phpdoc.org/guides"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.phpdoc.org/guides ../vendor/phpdocumentor/guides-cli/resources/schema/guides.xsd"
links-are-relative="true"
>
<extension
class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
project-home="https://github.com/werkraum-media/thuecat"
project-contact="coding@daniel-siepmann.de"
project-repository="https://github.com/werkraum-media/thuecat"
project-issues="https://github.com/werkraum-media/thuecat/issues"
edit-on-github-branch="main"
edit-on-github="werkraum-media/thuecat"
typo3-core-preferred="stable"
/>
<project
title="TYPO3 EXT:thuecat"
release="latest"
copyright="2020 by werkraum-media"
/>
<inventory
id="t3install"
url="https://docs.typo3.org/m/typo3/guide-installation/main/en-us/"
/>
<inventory
id="t3gettingstarted"
url="https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/"
/>
<inventory
id="t3tsref"
url="https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/"
/>
</guides>

View file

@ -1,70 +0,0 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
namespace WerkraumMedia\ThueCat\Tests\Acceptance;
use WerkraumMedia\ThueCat\Tests\Acceptance\Support\AcceptanceTester;
class BackendConfigurationCest
{
public function _before(AcceptanceTester $I): void
{
$I->amOnPage('/typo3');
$I->submitForm('#typo3-login-form', [
'username' => 'admin',
'p_field' => 'password',
]);
$I->waitForText('New TYPO3 site');
}
public function showsIndex(AcceptanceTester $I): void
{
$I->click('Configurations');
$I->switchToContentFrame();
$I->see('ThüCAT - Configurations');
$I->see('Example Configuration');
$I->see('Please provide an import configuration and trigger import to create an organisation.');
}
public function allowsToImportExistingConfiguration(AcceptanceTester $I): void
{
$I->click('Configurations');
$I->switchToContentFrame();
$I->see('Example Configuration');
$I->see('Never');
$I->click('Import based on import configuration');
$I->see('Import finished');
$I->see('Imported configuration "Example Configuration".');
$I->see('Tourist-Information Schmalkalden');
}
public function showsExecutedImport(AcceptanceTester $I): void
{
$I->click('Imports');
$I->switchToContentFrame();
$I->see('ThüCAT - Imports');
$I->see('Example Configuration');
}
}

View file

@ -1,87 +0,0 @@
<?php
declare(strict_types=1);
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
return [
'be_users' => [
0 => [
'uid' => '1',
'pid' => '0',
'tstamp' => '1366642540',
'username' => 'admin',
'password' => '$1$tCrlLajZ$C0sikFQQ3SWaFAZ1Me0Z/1',
'admin' => '1',
'disable' => '0',
'starttime' => '0',
'endtime' => '0',
'options' => '0',
'crdate' => '1366642540',
'workspace_perms' => '1',
'deleted' => '0',
'TSconfig' => null,
'lastlogin' => '1371033743',
'workspace_id' => '0',
],
],
'pages' => [
0 => [
'uid' => '1',
'pid' => '0',
'doktype' => PageRepository::DOKTYPE_DEFAULT,
'slug' => '/',
'title' => 'Rootpage',
],
1 => [
'uid' => '2',
'pid' => '1',
'doktype' => PageRepository::DOKTYPE_SYSFOLDER,
'slug' => '/storage',
'title' => 'Storage',
],
],
'tx_thuecat_import_configuration' => [
0 => [
'uid' => '1',
'pid' => '2',
'title' => 'Example Configuration',
'type' => 'static',
'configuration' => '<?xml version="1.0" encoding="utf-8" standalone="yes" ?><T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="storagePid">
<value index="vDEF">2</value>
</field>
<field index="urls">
<el index="el">
<field index="633554a57c83b383375701">
<value index="url">
<el>
<field index="url">
<value index="vDEF">https://thuecat.org/resources/644315157726-jmww</value>
</field>
</el>
</value>
<value index="_TOGGLE">0</value>
</field>
<field index="633551f49acee985442403">
<value index="url">
<el>
<field index="url">
<value index="vDEF">https://thuecat.org/resources/072778761562-kwah</value>
</field>
</el>
</value>
<value index="_TOGGLE">0</value>
</field>
</el>
</field>
</language>
</sheet>
</data>
</T3FlexForms>',
],
],
];

View file

@ -1,47 +0,0 @@
base: 'http://localhost:8080'
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
flag: de
websiteTitle: ''
languageId: 0
-
title: English
enabled: true
base: /en
typo3Language: default
locale: en_GB.UTF-8
iso-639-1: en
websiteTitle: ''
navigationTitle: English
hreflang: en-GB
direction: ''
flag: gb
languageId: 1
fallbackType: strict
fallbacks: '0'
-
title: French
enabled: true
base: /fr/
typo3Language: fr
locale: fr_FR.ytf8
iso-639-1: fr
websiteTitle: ''
navigationTitle: ''
hreflang: fr-FR
direction: ''
fallbackType: strict
fallbacks: '1,0'
flag: fr
languageId: 2
rootPageId: 1
websiteTitle: 'Example Website'

View file

@ -1,54 +0,0 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
namespace WerkraumMedia\ThueCat\Tests\Acceptance\Support;
use Codeception\Actor;
use TYPO3\TestingFramework\Core\Acceptance\Step\FrameSteps;
use WerkraumMedia\ThueCat\Tests\Acceptance\Support\_generated\AcceptanceTesterActions;
/**
* Inherited Methods
*
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause()
*
* @SuppressWarnings(PHPMD)
*/
class AcceptanceTester extends Actor
{
use FrameSteps;
use AcceptanceTesterActions;
/**
* Define custom actions here
*/
}

View file

@ -1,60 +0,0 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
namespace WerkraumMedia\ThueCat\Tests\Acceptance\Support;
use Codappix\Typo3PhpDatasets\TestingFramework;
use Codeception\Event\SuiteEvent;
use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment;
/**
* Load various core extensions and extension under test.
*/
class Environment extends BackendEnvironment
{
use TestingFramework;
protected $localConfig = [
'coreExtensionsToLoad' => [
'install',
'core',
'backend',
'extbase',
'frontend',
'fluid',
],
'testExtensionsToLoad' => [
'werkraummedia/thuecat',
],
'pathsToLinkInTestInstance' => [
'/../../../../../../Tests/Acceptance/Data/Sites/' => 'typo3conf/sites',
],
];
public function bootstrapTypo3Environment(SuiteEvent $suiteEvent)
{
parent::bootstrapTypo3Environment($suiteEvent);
$this->importPHPDataSet(__DIR__ . '/../Data/BasicDatabase.php');
}
}

View file

@ -1,2 +0,0 @@
*
!.gitignore

View file

@ -24,7 +24,10 @@ declare(strict_types=1);
namespace WerkraumMedia\ThueCat\Tests\Functional;
use Codappix\Typo3PhpDatasets\TestingFramework;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
{
@ -116,4 +119,21 @@ abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Funct
{
return self::getInstancePath() . '/typo3temp/var/log/typo3_error_0493d91d8e.log';
}
/**
* Workaround ConfigurationManager requiring request
*/
protected function workaroundExtbaseConfiguration(): void
{
$fakeRequest = new ServerRequest();
$fakeRequest = $fakeRequest->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);
$configurationManager = $this->get(ConfigurationManagerInterface::class);
// TODO: typo3/cms-core:14.0 Remove condition, the method should always be available
if (method_exists($configurationManager, 'setRequest') === false) {
return;
}
$configurationManager->setRequest($fakeRequest);
}
}

View file

@ -26,6 +26,7 @@ namespace WerkraumMedia\ThueCat\Tests\Functional;
use Codappix\Typo3PhpDatasets\TestingFramework;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
@ -683,12 +684,18 @@ class FrontendTest extends FunctionalTestCase
$html = (string)$this->executeFrontendSubRequest($request)->getBody();
$imgPrefix = '';
// TODO: typo3/cms-core:14.0 Remove $imgPrefix
if (version_compare((new Typo3Version())->__toString(), '13.0', '<')) {
$imgPrefix = '/';
}
self::assertStringContainsString(
'<img src="/fileadmin/tourismus/images/inhalte/sehenswertes/parks_gaerten/hirschgarten/2998_Spielplaetze_Hirschgarten.jpg" width="" height="" alt="" />',
'<img src="' . $imgPrefix . 'fileadmin/tourismus/images/inhalte/sehenswertes/parks_gaerten/hirschgarten/2998_Spielplaetze_Hirschgarten.jpg" width="" height="" alt="" />',
$html
);
self::assertStringContainsString(
'<img src="/fileadmin/tourismus/images/inhalte/sehenswertes/sehenswuerdigkeiten/Petersberg/20_Erfurt-Schriftzug_Petersberg_2021__c_Stadtverwaltung_Erfurt_CC-BY-NC-SA.JPG" width="" height="" alt="" />',
'<img src="' . $imgPrefix . 'fileadmin/tourismus/images/inhalte/sehenswertes/sehenswuerdigkeiten/Petersberg/20_Erfurt-Schriftzug_Petersberg_2021__c_Stadtverwaltung_Erfurt_CC-BY-NC-SA.JPG" width="" height="" alt="" />',
$html,
);
}

View file

@ -35,6 +35,8 @@ final class ImportConfigurationCommandTest extends AbstractImportTestCase
#[Test]
public function canImport(): void
{
$this->workaroundExtbaseConfiguration();
$subject = $this->getContainer()->get(ImportConfigurationCommand::class);
self::assertInstanceOf(Command::class, $subject);
@ -50,6 +52,8 @@ final class ImportConfigurationCommandTest extends AbstractImportTestCase
#[Test]
public function throwsExceptionOnNoneExistingConfiguration(): void
{
$this->workaroundExtbaseConfiguration();
$subject = $this->getContainer()->get(ImportConfigurationCommand::class);
self::assertInstanceOf(Command::class, $subject);

View file

@ -23,7 +23,11 @@ namespace WerkraumMedia\ThueCat\Tests\Functional;
* 02110-1301, USA.
*/
use DateTimeImmutable;
use DateTimeZone;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\DateTimeAspect;
use WerkraumMedia\ThueCat\Domain\Import\ImportConfiguration;
use WerkraumMedia\ThueCat\Domain\Import\Importer;
use WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportConfigurationRepository;
@ -387,6 +391,15 @@ class ImportTest extends AbstractImportTestCase
private function importConfiguration(): void
{
$this->workaroundExtbaseConfiguration();
$this->get(Context::class)->setAspect(
'date',
new DateTimeAspect(
new DateTimeImmutable('2024-03-03 00:00:00', new DateTimeZone('UTC'))
)
);
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
self::assertInstanceOf(ImportConfiguration::class, $configuration);
$this->get(Importer::class)->importConfiguration($configuration);

View file

@ -1,44 +0,0 @@
namespace: 'WerkraumMedia\ThueCat\Tests\Acceptance\Support'
paths:
tests: 'Tests/Acceptance'
data: 'Tests/Acceptance/Data'
output: '.Build/web/typo3temp/var/tests/AcceptanceReports'
support: 'Tests/Acceptance/Support'
settings:
debug: true
extensions:
enabled:
- 'Codeception\Extension\RunFailed'
suites:
acceptance:
actor: 'AcceptanceTester'
path: .
extensions:
enabled:
- 'Codeception\Extension\RunProcess':
- 'geckodriver > .Build/web/typo3temp/var/tests/AcceptanceReports/geckodriver.log 2>&1'
- 'TYPO3_PATH_APP="$INSTANCE_PATH" TYPO3_PATH_ROOT="$INSTANCE_PATH" php -S 127.0.0.1:8080 -t "$INSTANCE_PATH" > .Build/web/typo3temp/var/tests/AcceptanceReports/php.log 2>&1'
- 'WerkraumMedia\ThueCat\Tests\Acceptance\Support\Environment':
'typo3DatabaseUsername': 'testing'
'typo3DatabasePassword': 'testing'
modules:
enabled:
- WebDriver:
url: 'http://localhost:8080'
browser: 'firefox'
restart: true
path: ''
wait: 5
capabilities:
moz:firefoxOptions:
args:
- '-headless'
- '\TYPO3\TestingFramework\Core\Acceptance\Helper\Acceptance'
step_decorators:
- 'Codeception\Step\Retry'

View file

@ -42,28 +42,27 @@
"psr/http-factory": "^1.0",
"psr/http-message": "^2.0",
"psr/log": "^2.0 || ^3.0",
"symfony/console": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/property-access": "^6.4",
"symfony/property-info": "^6.4",
"symfony/console": "^6.4 || ^7.1",
"symfony/dependency-injection": "^6.4 || ^7.1",
"symfony/property-access": "^6.4 || ^7.1",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/serializer": "^6.4",
"typo3/cms-backend": "^12.4",
"typo3/cms-core": "^12.4",
"typo3/cms-extbase": "^12.4",
"typo3/cms-frontend": "^12.4",
"typo3/cms-install": "^12.4"
"typo3/cms-backend": "^12.4 || ^13.4",
"typo3/cms-core": "^12.4 || ^13.4",
"typo3/cms-extbase": "^12.4 || ^13.4",
"typo3/cms-frontend": "^12.4 || ^13.4",
"typo3/cms-install": "^12.4 || ^13.4"
},
"require-dev": {
"codappix/typo3-php-datasets": "^1.4",
"codeception/codeception": "^5.0",
"codeception/module-webdriver": "^4.0",
"friendsofphp/php-cs-fixer": "^3.40",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "1.10.46",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^10.4",
"phpunit/phpunit": "^10.4 || ^11.4",
"saschaegerer/phpstan-typo3": "^1.9",
"typo3/cms-fluid-styled-content": "^12.4",
"staabm/phpstan-todo-by": "^0.1.32",
"typo3/cms-fluid-styled-content": "^12.4 || ^13.4",
"typo3/testing-framework": "^8.0"
},
"config": {

View file

@ -10,7 +10,7 @@ $EM_CONF['thuecat'] = [
'author' => 'Daniel Siepmann',
'author_email' => 'coding@daniel-siepmann.de',
'author_company' => '',
'version' => '3.0.1',
'version' => '3.1.0',
'constraints' => [
'depends' => [
'core' => '',

View file

@ -40,11 +40,6 @@ parameters:
count: 1
path: Classes/Domain/Import/Typo3Converter/GeneralConverter.php
-
message: "#^Method WerkraumMedia\\\\ThueCat\\\\Domain\\\\Model\\\\Backend\\\\ImportConfiguration\\:\\:getConfigurationAsArray\\(\\) should return array but returns mixed\\.$#"
count: 1
path: Classes/Domain/Model/Backend/ImportConfiguration.php
-
message: "#^Method WerkraumMedia\\\\ThueCat\\\\Domain\\\\Model\\\\Backend\\\\ImportConfiguration\\:\\:getEntries\\(\\) should return array but returns mixed\\.$#"
count: 1
@ -215,11 +210,6 @@ parameters:
count: 1
path: Classes/Domain/Model/Frontend/OpeningHours.php
-
message: "#^Cannot call method getLanguageOverlay\\(\\) on string\\|TYPO3\\\\CMS\\\\Core\\\\Domain\\\\Repository\\\\PageRepository\\.$#"
count: 1
path: Classes/Frontend/DataProcessing/ResolveEntities.php
-
message: "#^Parameter \\#1 \\$className of method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Mapper\\\\DataMapper\\:\\:map\\(\\) expects class\\-string\\<TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\DomainObjectInterface\\>, string given\\.$#"
count: 1
@ -234,8 +224,3 @@ parameters:
message: "#^Parameter \\#1 \\$mods of method WerkraumMedia\\\\ThueCat\\\\Updates\\\\BackendModuleUserPermission\\:\\:updateMods\\(\\) expects string, mixed given\\.$#"
count: 1
path: Classes/Updates/BackendModuleUserPermission.php
-
message: "#^Method WerkraumMedia\\\\ThueCat\\\\Tests\\\\Acceptance\\\\Support\\\\Environment\\:\\:bootstrapTypo3Environment\\(\\) has no return type specified\\.$#"
count: 1
path: Tests/Acceptance/Support/Environment.php

View file

@ -49,26 +49,6 @@ let
'';
};
projectTestAcceptance = pkgs.writeShellApplication {
name = "project-test-acceptance";
runtimeInputs = [
projectInstall
pkgs.sqlite
pkgs.firefox
pkgs.geckodriver
php
];
text = ''
project-install
export INSTANCE_PATH="$PROJECT_ROOT/.Build/web/typo3temp/var/tests/acceptance"
export typo3DatabaseDriver=pdo_sqlite
mkdir -p "$INSTANCE_PATH"
./vendor/bin/codecept run
'';
};
in pkgs.mkShell {
name = "TYPO3 Extension ThüCAT";
buildInputs = [
@ -77,7 +57,6 @@ in pkgs.mkShell {
projectInstall
projectCgl
projectCglFix
projectTestAcceptance
];
shellHook = ''