Skip to content

Commit

Permalink
Merge pull request #26 from eliashaeussler/feature/typo3-13.1
Browse files Browse the repository at this point in the history
[FEATURE] Add support for TYPO3 v13.1
  • Loading branch information
eliashaeussler committed May 4, 2024
2 parents 6d4ef6f + 3160c01 commit 2894adc
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
fail-fast: false
matrix:
php-version: ["8.1", "8.2", "8.3"]
typo3-version: ["11.5", "12.4", "13.0"]
typo3-version: ["11.5", "12.4", "13.1"]
dependencies: ["highest", "lowest"]
exclude:
- php-version: "8.1"
typo3-version: "13.0"
typo3-version: "13.1"
env:
typo3DatabaseName: typo3
typo3DatabaseHost: '127.0.0.1'
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Installation/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Requirements
============

- PHP 8.1 - 8.3
- TYPO3 11.5 LTS - 13.0
- TYPO3 11.5 LTS - 13.1

.. _steps:

Expand All @@ -36,7 +36,9 @@ Version matrix
+--------------------+---------------------+---------------+
| Extension versions | TYPO3 versions | PHP versions |
+====================+=====================+===============+
| **since 0.1.2** | **11.5 LTS - 13.0** | **8.1 - 8.3** |
| **since 0.1.3** | **11.5 LTS - 13.1** | **8.1 - 8.3** |
+--------------------+---------------------+---------------+
| 0.1.2 | 11.5 LTS - 13.0 | 8.1 - 8.3 |
+--------------------+---------------------+---------------+
| 0.1.0 - 0.1.1 | 11.5 LTS - 12.4 LTS | 8.1 - 8.3 |
+--------------------+---------------------+---------------+
2 changes: 1 addition & 1 deletion Documentation/Introduction/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Features
- :ref:`Configuration <configuration>` option to manage sitemap injection on a
per-site basis
- Supports :ref:`static routes <static-route>` and :ref:`local files <local-file>`
- Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.0 (see :ref:`version matrix <version-matrix>`)
- Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.1 (see :ref:`version matrix <version-matrix>`)

.. _support:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static routes as well as injection into local files.
* Middleware to inject sitemap configurations into `robots.txt`
* Manage sitemap injection on a per-site basis using site configuration
* Supports static routes and local files
* Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.0
* Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.1

## 🔥 Installation

Expand Down
70 changes: 70 additions & 0 deletions Tests/CGL/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,82 @@ parameters:
count: 1
path: ../Functional/Fixtures/DummyRequestFactory.php

-
message: "#^Call to method createNewBasicSite\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Call to method write\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 1 parameter, 2\\-3 required\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 4 parameters, 2\\-3 required\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory not found\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter not found\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\EventDispatcher\\\\NoopEventDispatcher given\\.$#"
count: 1
path: ../Functional/Middleware/RobotsTxtSitemapHandlerTest.php

-
message: "#^Call to method createNewBasicSite\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Call to method write\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 1 parameter, 2\\-3 required\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 4 parameters, 2\\-3 required\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory not found\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter not found\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php

-
message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\EventDispatcher\\\\NoopEventDispatcher given\\.$#"
count: 1
path: ../Functional/Resource/RobotsTxtEnhancerTest.php
21 changes: 15 additions & 6 deletions Tests/Functional/SiteTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,32 @@ private function createSite(
$typo3Version = new Core\Information\Typo3Version();

if ($typo3Version->getMajorVersion() >= 13) {
$coreCache = new Core\Cache\Frontend\NullFrontend('core');
$eventDispatcher = new Core\EventDispatcher\NoopEventDispatcher();

$siteConfiguration = new Core\Configuration\SiteConfiguration(
$configPath,
new Core\EventDispatcher\NoopEventDispatcher(),
new Core\Cache\Frontend\NullFrontend('core'),
$this->get(Core\Site\SiteSettingsFactory::class),
$eventDispatcher,
$coreCache,
);
$siteWriter = new Core\Configuration\SiteWriter(
$configPath,
$eventDispatcher,
$coreCache,
);
} elseif (($typo3Version)->getMajorVersion() >= 12) {
// @todo Remove once support for TYPO3 v12 is dropped
$siteConfiguration = new Core\Configuration\SiteConfiguration(
$siteConfiguration = $siteWriter = new Core\Configuration\SiteConfiguration(
$configPath,
new Core\EventDispatcher\NoopEventDispatcher(),
);
} else {
// @todo Remove once support for TYPO3 v11 is dropped
$siteConfiguration = new Core\Configuration\SiteConfiguration($configPath);
$siteConfiguration = $siteWriter = new Core\Configuration\SiteConfiguration($configPath);
}

$siteConfiguration->createNewBasicSite(static::$testSiteIdentifier, 1, $baseUrl);
$siteWriter->createNewBasicSite(static::$testSiteIdentifier, 1, $baseUrl);

$rawConfig = $siteConfiguration->load(static::$testSiteIdentifier);
$rawConfig['sitemap_robots_inject'] = $injectSitemaps;
Expand Down Expand Up @@ -88,7 +97,7 @@ private function createSite(
'languageId' => 2,
];

$siteConfiguration->write(static::$testSiteIdentifier, $rawConfig);
$siteWriter->write(static::$testSiteIdentifier, $rawConfig);

$site = $siteConfiguration->getAllExistingSites()[static::$testSiteIdentifier] ?? null;

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"psr/http-server-middleware": "^1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"typo3/cms-core": "~11.5.19 || ~12.4.0 || ~13.0.0"
"typo3/cms-core": "~11.5.19 || ~12.4.0 || ~13.1.0"
},
"require-dev": {
"eliashaeussler/transient-logger": "^1.0",
"phpunit/phpcov": "^8.2 || ^9.0 || ^10.0",
"typo3/cms-seo": "~11.5.19 || ~12.4.0 || ~13.0.0",
"typo3/cms-seo": "~11.5.19 || ~12.4.0 || ~13.1.0",
"typo3/testing-framework": "^7.0.2 || ^8.0.9"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'author_email' => 'elias@haeussler.dev',
'constraints' => [
'depends' => [
'typo3' => '11.5.19-13.0.99',
'typo3' => '11.5.19-13.1.99',
'php' => '8.1.0-8.3.99',
'sitemap_locator' => '0.1.0-0.1.99',
],
Expand Down

0 comments on commit 2894adc

Please sign in to comment.