Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TYPO3 v12 #9

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,23 @@ jobs:
matrix:
include:
- php-version: '7.4'
typo3-version: '^11.5'
- php-version: '8.0'
typo3-version: '^11.5'
- php-version: '8.0'
typo3-version: '^11.5'
- php-version: '8.1'
typo3-version: '^11.5'
- php-version: '8.2'
typo3-version: '^11.5'
- php-version: '8.3'
typo3-version: '^11.5'
- php-version: '8.1'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
steps:
- uses: actions/checkout@v3

Expand All @@ -86,7 +99,7 @@ jobs:

- name: Install dependencies
run: |-
composer require --no-interaction --prefer-dist --no-progress
composer req "typo3/cms-core:${{ matrix.typo3-version }}" --prefer-dist --no-progress --no-interaction
./vendor/bin/codecept build

- name: Code Quality (by PHPStan)
Expand All @@ -98,10 +111,21 @@ jobs:
matrix:
include:
- php-version: '7.4'
typo3-version: '^11.5'
- php-version: '8.0'
typo3-version: '^11.5'
- php-version: '8.1'
typo3-version: '^11.5'
- php-version: '8.2'
typo3-version: '^11.5'
- php-version: '8.3'
typo3-version: '^11.5'
- php-version: '8.1'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
steps:
- uses: actions/checkout@v3

Expand All @@ -126,7 +150,7 @@ jobs:
done

- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
run: composer req "typo3/cms-core:${{ matrix.typo3-version }}" --prefer-dist --no-progress --no-interaction

- name: PHPUnit Tests
env:
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/WatchlistController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
protected function initializeAction(): void
{
if ($this->request->hasArgument('watchlist') === false) {
$this->request->setArgument('watchlist', 'default');
$this->request = $this->request->withArgument('watchlist', 'default');
}
}

Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,11 @@ Example
A concrete example can be found within ``Tests/Fixtures/FrontendRendering.typoscript``.
This example includes the provided JavaScript file as well as some custom CSS and Markup.
The content element is not necessary.

Changelog
=========

v1.1.0
------

* Add Support for TYPO3 v12 and newer PHP versions.
2 changes: 1 addition & 1 deletion Tests/Fixtures/watchlist_example/Classes/ItemHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private function getPageRecord(int $uid): array
$qb->from('pages');
$qb->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)));
$qb->setMaxResults(1);
return $qb->execute()->fetchAssociative() ?: [];
return $qb->executeQuery()->fetchAssociative() ?: [];
}

private function getImage(int $uid): ?FileReference
Expand Down
47 changes: 24 additions & 23 deletions Tests/Functional/BasicsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,33 @@

class BasicsTest extends FunctionalTestCase
{
protected $coreExtensionsToLoad = [
'fluid_styled_content',
];

protected $testExtensionsToLoad = [
'typo3conf/ext/watchlist',
'typo3conf/ext/watchlist/Tests/Fixtures/watchlist_example',
];

protected $pathsToLinkInTestInstance = [
'typo3conf/ext/watchlist/Tests/Fixtures/Sites' => 'typo3conf/sites',
'typo3conf/ext/watchlist/Tests/Fixtures/Fileadmin/Files' => 'fileadmin/Files',
];

protected $configurationToUseInTestInstance = [
'FE' => [
'cacheHash' => [
'excludedParameters' => [
'^tx_watchlist_watchlist[',
protected function setUp(): void
{
$this->coreExtensionsToLoad = [
'typo3/cms-fluid-styled-content',
'typo3/cms-form',
];

$this->testExtensionsToLoad = [
'werkraummedia/watchlist',
'typo3conf/ext/watchlist/Tests/Fixtures/watchlist_example',
];

$this->pathsToLinkInTestInstance = [
'typo3conf/ext/watchlist/Tests/Fixtures/Sites' => 'typo3conf/sites',
'typo3conf/ext/watchlist/Tests/Fixtures/Fileadmin/Files' => 'fileadmin/Files',
];

$this->configurationToUseInTestInstance = [
'FE' => [
'cacheHash' => [
'excludedParameters' => [
'^tx_watchlist_watchlist[',
],
],
],
],
];
];

protected function setUp(): void
{
parent::setUp();

$this->importCSVDataSet(__DIR__ . '/../Fixtures/BasicDatabase.csv');
Expand Down
29 changes: 14 additions & 15 deletions Tests/Functional/FormIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@

class FormIntegrationTest extends FunctionalTestCase
{
protected $coreExtensionsToLoad = [
'fluid_styled_content',
'form',
'tstemplate',
];
protected function setUp(): void
{
$this->coreExtensionsToLoad = [
'typo3/cms-fluid-styled-content',
'typo3/cms-form',
];

protected $testExtensionsToLoad = [
'typo3conf/ext/watchlist',
'typo3conf/ext/watchlist/Tests/Fixtures/watchlist_example',
];
$this->testExtensionsToLoad = [
'werkraummedia/watchlist',
'typo3conf/ext/watchlist/Tests/Fixtures/watchlist_example',
];

protected $pathsToLinkInTestInstance = [
'typo3conf/ext/watchlist/Tests/Fixtures/Sites' => 'typo3conf/sites',
'typo3conf/ext/watchlist/Tests/Fixtures/Fileadmin/Files' => 'fileadmin/Files',
];
$this->pathsToLinkInTestInstance = [
'typo3conf/ext/watchlist/Tests/Fixtures/Sites' => 'typo3conf/sites',
'typo3conf/ext/watchlist/Tests/Fixtures/Fileadmin/Files' => 'fileadmin/Files',
];

protected function setUp(): void
{
parent::setUp();

$this->importCSVDataSet(__DIR__ . '/../Fixtures/BasicDatabase.csv');
Expand Down
28 changes: 15 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,30 @@
},
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"typo3/cms-backend": "^11.5",
"typo3/cms-core": "^11.5",
"typo3/cms-extbase": "^11.5",
"typo3/cms-frontend": "^11.5"
"typo3/cms-backend": "^11.5 || ^12.4",
"typo3/cms-core": "^11.5 || ^12.4",
"typo3/cms-extbase": "^11.5 || ^12.4",
"typo3/cms-fluid-styled-content": "^11.5 || ^12.4",
"typo3/cms-form": "^11.5 || ^12.4",
"typo3/cms-frontend": "^11.5 || ^12.4"
},
"require-dev": {
"codeception/codeception": "^4.2",
"codeception/module-webdriver": "^2.0",
"codeception/codeception": "^5.0",
"codeception/module-webdriver": "^3.2",
"cweagans/composer-patches": "^1.7",
"friendsofphp/php-cs-fixer": "^3.11",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "1.1.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"saschaegerer/phpstan-typo3": "^1.1",
"typo3/cms-fluid-styled-content": "^11.5",
"typo3/cms-form": "^11.5",
"typo3/cms-tstemplate": "^11.5",
"typo3/testing-framework": "^6.6"
"saschaegerer/phpstan-typo3": "^1.8",
"typo3/testing-framework": "^7.0 || ^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"lock": false,
"config": {
"sort-packages": true,
"lock": false,
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true,
Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ parameters:
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: true
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- "#^Cannot call method fetchAssociative\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#"
- "#^Right side of \\|\\| is always false\\.$#"
17 changes: 7 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
>

cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
requireCoverageMetadata="false"
>
<testsuites>
<testsuite name="unit">
<directory>Tests/Unit/</directory>
Expand All @@ -26,11 +23,11 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory suffix=".php">Classes</directory>
</include>
</coverage>
</source>

<php>
<env name="typo3DatabaseDriver" value="pdo_sqlite"/>
Expand Down
26 changes: 21 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { }
,phps ? import <phps>
}:

let
php = pkgs.php81;
composer = pkgs.php81Packages.composer;
php = phps.packages.x86_64-linux.php83.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);

extraConfig = ''
xdebug.mode = debug
memory_limit = 4G
'';
};
inherit(php.packages) composer;


projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
composer
];
text = ''
composer install --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
rm -rf .Build/ vendor/
composer update --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
'';
};
projectValidateComposer = pkgs.writeShellApplication {
Expand Down Expand Up @@ -60,7 +74,7 @@ let
text = ''
project-install

export INSTANCE_PATH="$PROJECT_ROOT/.Build/web/typo3temp/var/tests/acceptance/"
export INSTANCE_PATH="$PROJECT_ROOT/.Build/web/typo3temp/var/tests/acceptance"

mkdir -p "$INSTANCE_PATH"
./vendor/bin/codecept run
Expand All @@ -77,6 +91,8 @@ in pkgs.mkShell {
projectValidateXml
projectCodingGuideline
projectTestAcceptance
php
composer
];

shellHook = ''
Expand Down
Loading