diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 483796d..b45d190 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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) @@ -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 @@ -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: diff --git a/Classes/Controller/WatchlistController.php b/Classes/Controller/WatchlistController.php index abdf508..336d66c 100644 --- a/Classes/Controller/WatchlistController.php +++ b/Classes/Controller/WatchlistController.php @@ -44,7 +44,7 @@ class WatchlistController extends ActionController protected function initializeAction(): void { if ($this->request->hasArgument('watchlist') === false) { - $this->request->setArgument('watchlist', 'default'); + $this->request = $this->request->withArgument('watchlist', 'default'); } } diff --git a/README.rst b/README.rst index 70a6e24..c11db1f 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/Tests/Fixtures/watchlist_example/Classes/ItemHandler.php b/Tests/Fixtures/watchlist_example/Classes/ItemHandler.php index 3137a20..c521e4a 100644 --- a/Tests/Fixtures/watchlist_example/Classes/ItemHandler.php +++ b/Tests/Fixtures/watchlist_example/Classes/ItemHandler.php @@ -67,7 +67,7 @@ class ItemHandler implements ItemHandlerInterface $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 diff --git a/Tests/Functional/BasicsTest.php b/Tests/Functional/BasicsTest.php index e176d6b..aa0a4fc 100644 --- a/Tests/Functional/BasicsTest.php +++ b/Tests/Functional/BasicsTest.php @@ -30,32 +30,33 @@ use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; 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[', + ], + ], + ], + ]; + parent::setUp(); $this->importCSVDataSet(__DIR__ . '/../Fixtures/BasicDatabase.csv'); diff --git a/Tests/Functional/FormIntegrationTest.php b/Tests/Functional/FormIntegrationTest.php index edc6755..7468d7a 100644 --- a/Tests/Functional/FormIntegrationTest.php +++ b/Tests/Functional/FormIntegrationTest.php @@ -28,24 +28,23 @@ use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; class FormIntegrationTest extends FunctionalTestCase { - protected $coreExtensionsToLoad = [ - 'fluid_styled_content', - 'form', - 'tstemplate', - ]; - - 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 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', + ]; + parent::setUp(); $this->importCSVDataSet(__DIR__ . '/../Fixtures/BasicDatabase.csv'); diff --git a/composer.json b/composer.json index 1b80ab2..a5458b2 100644 --- a/composer.json +++ b/composer.json @@ -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, diff --git a/phpstan.neon b/phpstan.neon index 8f5d2ed..1df9b35 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -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\\.$#" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 858b92f..86ceb34 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,19 @@ - + cacheDirectory=".phpunit.cache" + backupStaticProperties="false" + requireCoverageMetadata="false" +> Tests/Unit/ @@ -26,11 +23,11 @@ - + Classes - + diff --git a/shell.nix b/shell.nix index 8302708..cc10360 100644 --- a/shell.nix +++ b/shell.nix @@ -1,8 +1,21 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { } + ,phps ? import +}: 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"; @@ -10,7 +23,8 @@ let 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 { @@ -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 @@ -77,6 +91,8 @@ in pkgs.mkShell { projectValidateXml projectCodingGuideline projectTestAcceptance + php + composer ]; shellHook = ''