diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 459757b..b633689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: push: branches: - main - - 4.0 + - typo3-v14 pull_request: permissions: contents: read @@ -69,7 +69,6 @@ jobs: - "php:csfix" - "php:sniff" - "ts:lint" - - "xliff:lint" php-version: - "8.2" - "8.3" @@ -115,16 +114,16 @@ jobs: fail-fast: false matrix: include: - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.2" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.3" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.4" composer-dependencies: highest - - typo3-version: "^13.4" + - typo3-version: "^14.0" php-version: "8.5" composer-dependencies: highest functional-tests: @@ -143,25 +142,25 @@ jobs: uses: actions/checkout@v4 - name: Install testing system - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }} - name: Functional Tests with mariadb (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.4 -s functional - name: Functional Tests with mariadb (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -i 10.11 -s functional - name: Functional Tests with mysql (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional - name: Functional Tests with mysql (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -i 8.4 -s functional - name: Functional Tests with postgres (min) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 10 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 10 -s functional - name: Functional Tests with postgres (max) - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -i 18 -s functional + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -i 18 -s functional - name: Functional Tests with sqlite - run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d sqlite -s functional \ No newline at end of file + run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d sqlite -s functional \ No newline at end of file diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 1a31e08..dc72ec4 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -45,8 +45,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.2" - if ! [[ ${DBMS_VERSION} =~ ^(10.2|10.3|10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1|11.4|11.8)$ ]]; then + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.11" + if ! [[ ${DBMS_VERSION} =~ ^(10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1|11.4|11.8)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -61,8 +61,8 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="5.5" - if ! [[ ${DBMS_VERSION} =~ ^(5.5|5.6|5.7|8.0|8.4)$ ]]; then + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.4" + if ! [[ ${DBMS_VERSION} =~ ^(8.0|8.1|8.2|8.3|8.4|9.5)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 @@ -76,7 +76,7 @@ handleDbmsOptions() { echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 exit 1 fi - [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10" + [ -z "${DBMS_VERSION}" ] && DBMS_VERSION="16" if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16|17|18)$ ]]; then echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2 echo >&2 @@ -151,7 +151,7 @@ restoreComposerFiles() { loadHelp() { # Load help text into $HELP - read -r -d '' HELP < + -t <13> Only with -s composerInstall|composerInstallMin|composerInstallMax Specifies the TYPO3 CORE Version to be used - - 11.5: use TYPO3 v11 (default) - - 12.4: use TYPO3 v12 - - 13.4: use TYPO3 v13 + - 13.4: use TYPO3 v13 (default) + - 14.0: use TYPO3 v14 - -p <7.4|8.0|8.1|8.2|8.3|8.4|8.5> + -p <8.2|8.3|8.4|8.5> Specifies the PHP minor version to be used - - 7.4: use PHP 7.4 (default) - - 8.0: use PHP 8.0 - - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - - 8.3: use PHP 8.3 + - 8.3: use PHP 8.3 (default) - 8.4: use PHP 8.4 - - 8.5: use PHP 8.5 + - 8.5: use PHP 8.5 -e "" Only with -s docsGenerate|functional|unit @@ -283,24 +274,24 @@ Options: Show this help. Examples: - # Run all core unit tests using PHP 7.4 + # Run all core unit tests using PHP 8.5 ./Build/Scripts/runTests.sh -s unit # Run all core units tests and enable xdebug (have a PhpStorm listening on port 9003!) ./Build/Scripts/runTests.sh -x -s unit - # Run unit tests in phpunit verbose mode with xdebug on PHP 8.1 and filter for test canRetrieveValueWithGP - ./Build/Scripts/runTests.sh -x -p 8.1 -- --filter 'classCanBeRegistered' + # Run unit tests in phpunit verbose mode with xdebug on PHP 8.3 and filter for test canRetrieveValueWithGP + ./Build/Scripts/runTests.sh -x -p 8.3 -- --filter 'classCanBeRegistered' # Run functional tests in phpunit with a filtered test method name in a specified file # example will currently execute two tests, both of which start with the search term ./Build/Scripts/runTests.sh -s functional -- --filter 'findRecordByImportSource' Tests/Functional/Repository/CategoryRepositoryTest.php - # Run functional tests on postgres with xdebug, php 8.1 and execute a restricted set of tests - ./Build/Scripts/runTests.sh -x -p 8.1 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php + # Run functional tests on postgres with xdebug, php 8.3 and execute a restricted set of tests + ./Build/Scripts/runTests.sh -x -p 8.3 -s functional -d postgres -- Tests/Functional/Repository/CategoryRepositoryTest.php - # Run functional tests on postgres 11 - ./Build/Scripts/runTests.sh -s functional -d postgres -i 11 + # Run functional tests on postgres 16 + ./Build/Scripts/runTests.sh -s functional -d postgres -i 16 EOF } @@ -319,17 +310,17 @@ ROOT_DIR="${PWD}" # Option defaults TEST_SUITE="" -TYPO3_VERSION="11" +TYPO3_VERSION="14" DBMS="sqlite" DBMS_VERSION="" -PHP_VERSION="8.1" +PHP_VERSION="8.3" PHP_XDEBUG_ON=0 PHP_XDEBUG_PORT=9003 EXTRA_TEST_OPTIONS="" CGLCHECK_DRY_RUN=0 DATABASE_DRIVER="" CONTAINER_BIN="" -COMPOSER_ROOT_VERSION="12.4.2" +COMPOSER_ROOT_VERSION="14.0.1" CONTAINER_INTERACTIVE="-it --init" HOST_UID=$(id -u) HOST_PID=$(id -g) @@ -369,7 +360,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3|8.4|8.5)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(8.2|8.3|8.4|8.5)$ ]]; then INVALID_OPTIONS+=("-p ${OPTARG}") fi ;; @@ -378,7 +369,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; t) TYPO3_VERSION=${OPTARG} - if ! [[ ${TYPO3_VERSION} =~ ^(11|12|13)$ ]]; then + if ! [[ ${TYPO3_VERSION} =~ ^(14)$ ]]; then INVALID_OPTIONS+=("-t ${OPTARG}") fi ;; @@ -451,7 +442,7 @@ mkdir -p .cache mkdir -p .Build/public/typo3temp/var/tests IMAGE_PHP="ghcr.io/typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest" -IMAGE_ALPINE="docker.io/alpine:3.8" +IMAGE_ALPINE="docker.io/alpine:3.22" IMAGE_DOCS="ghcr.io/typo3-documentation/render-guides:latest" IMAGE_MARIADB="docker.io/mariadb:${DBMS_VERSION}" IMAGE_MYSQL="docker.io/mysql:${DBMS_VERSION}" @@ -516,17 +507,9 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-highest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c " - if [ ${TYPO3_VERSION} -eq 11 ]; then + if [ ${TYPO3_VERSION} -eq 14 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 12 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^12.4.2 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 13 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^13.4 || exit 1 + typo3/cms-core:^14.0 || exit 1 fi composer update --no-progress --no-interaction || exit 1 composer show || exit 1 @@ -538,17 +521,9 @@ case ${TEST_SUITE} in cleanComposer stashComposerFiles ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-lowest-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c " - if [ ${TYPO3_VERSION} -eq 11 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^11.5.24 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 12 ]; then - composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^12.4.2 || exit 1 - fi - if [ ${TYPO3_VERSION} -eq 13 ]; then + if [ ${TYPO3_VERSION} -eq 14 ]; then composer require --no-ansi --no-interaction --no-progress --no-install \ - typo3/cms-core:^13.4 || exit 1 + typo3/cms-core:^14.0 || exit 1 fi composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest || exit 1 composer show || exit 1 @@ -588,7 +563,11 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; postgres) - ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs /var/lib/postgresql/data:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null + POSTGRES_TMPFS="/var/lib/postgresql/data" + if [[ ${DBMS_VERSION} -eq 18 ]]; then + POSTGRES_TMPFS="/var/lib/postgresql" + fi + ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs ${POSTGRES_TMPFS}:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null waitFor postgres-func-${SUFFIX} 5432 CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=bamboo -e typo3DatabaseUsername=funcu -e typo3DatabaseHost=postgres-func-${SUFFIX} -e typo3DatabasePassword=funcp" ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php index a95bc52..9882f8f 100644 --- a/Build/phpunit/FunctionalTestsBootstrap.php +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -1,4 +1,5 @@ prepareView(); + $this->prepareView($request); + $redirectAccess = GeneralUtility::makeInstance(RedirectAccessDisplayCondition::class); $this->view->assignMultiple([ + 'canEditRedirects' => $redirectAccess->canEditRedirects(), 'redirects' => $redirectDemandService->getRedirects((int)$currentPage), 'demand' => $redirectDemandService->getDemand(), 'pagination' => $redirectDemandService->preparePagination($redirectDemandService->getDemand()), @@ -40,21 +47,23 @@ public function render(): array ]); $result = $this->initializeResultArray(); - $result['html'] = $this->view->render(); + $result['html'] = $this->view->render('List'); return $result; } - protected function prepareView(): void + protected function prepareView(ServerRequestInterface $request): void { - $templateName = 'List'; - $this->view = GeneralUtility::makeInstance(StandaloneView::class); - $this->view->setTemplate($templateName); - $this->view->setTemplateRootPaths(['EXT:redirect_tab/Resources/Private/Templates/Backend']); - $this->view->setPartialRootPaths(['EXT:redirect_tab/Resources/Private/Partials/Backend']); - $this->view->setLayoutRootPaths(['EXT:redirect_tab/Resources/Private/Layouts']); + $viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class); + $viewFactoryData = new ViewFactoryData( + templateRootPaths: ['EXT:redirect_tab/Resources/Private/Templates/Backend'], + partialRootPaths: ['EXT:redirect_tab/Resources/Private/Partials/Backend'], + layoutRootPaths: ['EXT:redirect_tab/Resources/Private/Layouts'], + request: $request, + ); + $this->view = $viewFactory->create($viewFactoryData); } - protected function buildRedirectUrl(int $currentPage): UriInterface|Uri + protected function buildRedirectUrl(int $currentPage): UriInterface|Uri|null { $backendUriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriParameters = [ @@ -66,6 +75,10 @@ protected function buildRedirectUrl(int $currentPage): UriInterface|Uri 'page' => $currentPage, ]; - return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters); + try { + return $backendUriBuilder->buildUriFromRoute('record_edit', $uriParameters); + } catch (RouteNotFoundException) { + return null; + } } } diff --git a/Classes/Service/RedirectDemandService.php b/Classes/Service/RedirectDemandService.php index 42cad9e..cd7937c 100644 --- a/Classes/Service/RedirectDemandService.php +++ b/Classes/Service/RedirectDemandService.php @@ -8,43 +8,17 @@ use Psr\EventDispatcher\EventDispatcherInterface; use TYPO3\CMS\Core\Site\Entity\NullSite; use TYPO3\CMS\Core\Site\Entity\Site; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Redirects\Repository\Demand; use TYPO3\CMS\Redirects\Repository\RedirectRepository; class RedirectDemandService { - protected array $data = []; - - protected ?Demand $demand = null; - - private RedirectRepository $redirectRepository; - private EventDispatcherInterface $eventDispatcher; - - public function __construct() - { - $this->redirectRepository = GeneralUtility::makeInstance(RedirectRepository::class); - $this->eventDispatcher = GeneralUtility::makeInstance(EventDispatcherInterface::class); - } - - public function getData(): array - { - return $this->data; - } - - public function setData(array $data): void - { - $this->data = $data; - } - - public function getDemand(): ?Demand - { - return $this->demand; - } - - public function setDemand(?Demand $demand): void - { - $this->demand = $demand; + public function __construct( + protected RedirectRepository $redirectRepository, + protected EventDispatcherInterface $eventDispatcher, + protected ?Demand $demand = null, + protected array $data = [] + ) { } /** @@ -66,12 +40,10 @@ public function getRedirects(int $page = 1): array $page, 'source_host', 'asc', + Demand::DEFAULT_REDIRECT_TYPE, ['*', $host], '', 't3://page?uid=' . $this->data['effectivePid'], - [], - 0, - null ); $redirects = $this->redirectRepository->findRedirectsByDemand($this->demand); } @@ -84,7 +56,7 @@ public function preparePagination(?Demand $demand): array { $pagination = []; if ($demand !== null) { - $count = $this->redirectRepository->countRedirectsByByDemand($demand); + $count = $this->redirectRepository->countRedirectsByDemand($demand); $numberOfPages = ceil($count / $demand->getLimit()); $endRecord = $demand->getOffset() + $demand->getLimit(); if ($endRecord > $count) { @@ -108,4 +80,19 @@ public function preparePagination(?Demand $demand): array } return $pagination; } + + public function getData(): array + { + return $this->data; + } + + public function setData(array $data): void + { + $this->data = $data; + } + + public function getDemand(): ?Demand + { + return $this->demand; + } } diff --git a/Classes/UserFunctions/RedirectAccessDisplayCondition.php b/Classes/UserFunctions/RedirectAccessDisplayCondition.php new file mode 100644 index 0000000..0e383b2 --- /dev/null +++ b/Classes/UserFunctions/RedirectAccessDisplayCondition.php @@ -0,0 +1,27 @@ +getBackendUser()->isAdmin() || $this->getBackendUser()->check('tables_select', self::TABLE_NAME); + } + + public function canEditRedirects(): bool + { + return $this->getBackendUser()->isAdmin() || $this->getBackendUser()->check('tables_modify', self::TABLE_NAME); + } + + protected function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } +} diff --git a/Classes/ViewHelpers/RouteParametersViewHelper.php b/Classes/ViewHelpers/RouteParametersViewHelper.php index abe1537..be60651 100644 --- a/Classes/ViewHelpers/RouteParametersViewHelper.php +++ b/Classes/ViewHelpers/RouteParametersViewHelper.php @@ -9,8 +9,8 @@ class RouteParametersViewHelper extends AbstractViewHelper public function initializeArguments(): void { parent::initializeArguments(); - $this->registerArgument('recordUid', 'integer', 'Record Uid', true, 0); - $this->registerArgument('page', 'integer', 'Pagination Page', true, 0); + $this->registerArgument('recordUid', 'integer', 'Record Uid', true); + $this->registerArgument('page', 'integer', 'Pagination Page', true); } public function render(): array diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index fc8d880..bb7e0d9 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,5 +1,6 @@ [ 'AND' => [ 'REC:NEW:false', + 'USER:' . RedirectAccessDisplayCondition::class . '->canListRedirects', ], ], 'exclude' => true, diff --git a/README.md b/README.md index 3257dbf..71ee620 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,13 @@ composer require ayacoo/redirect-tab ### 3.1 Versions and support -| redirect_tab | TYPO3 | PHP | Support / Development | -|--------------|-------|-----------|-----------------------------| -| 4.x | 13.x | 8.2 - 8.5 | features, bugfixes, security updates | -| 3.x | 12.x | 8.1 - 8.4 | bugfixes, security updates | -| 2.x | 11.x | 7.4 - 8.0 | bugfixes, security updates | -| 1.x | 10.x | 7.2 - 7.4 | no support any more | +| redirect_tab | TYPO3 | PHP | Support / Development | +|--------------|-------|-----------|--------------------------------------| +| 5.x | 14.x | 8.2 - 8.5 | features, bugfixes, security updates | +| 4.x | 13.x | 8.2 - 8.5 | bugfixes, security updates | +| 3.x | 12.x | 8.1 - 8.4 | bugfixes, security updates | +| 2.x | 11.x | 7.4 - 8.0 | no support any more | +| 1.x | 10.x | 7.2 - 7.4 | no support any more | ### 3.2 Release Management diff --git a/Resources/Private/Templates/Backend/List.html b/Resources/Private/Templates/Backend/List.html index 865c147..0266f10 100644 --- a/Resources/Private/Templates/Backend/List.html +++ b/Resources/Private/Templates/Backend/List.html @@ -41,9 +41,16 @@ - - {redirect.source_path -> f:format.crop(maxCharacters:100)} - + + + + {redirect.source_path -> f:format.crop(maxCharacters:100)} + + + + {redirect.source_path -> f:format.crop(maxCharacters:100)} + + @@ -64,26 +71,31 @@ - + + - + + + + + + + + + + + + + + - - - - - - - - - @@ -96,9 +108,11 @@

- - - + + + + +
diff --git a/Resources/Public/Icons/Extension.svg b/Resources/Public/Icons/Extension.svg new file mode 100644 index 0000000..cc48900 --- /dev/null +++ b/Resources/Public/Icons/Extension.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Tests/Functional/Service/RedirectDemandServiceTest.php b/Tests/Functional/Service/RedirectDemandServiceTest.php index 3e96277..0847bb4 100644 --- a/Tests/Functional/Service/RedirectDemandServiceTest.php +++ b/Tests/Functional/Service/RedirectDemandServiceTest.php @@ -6,6 +6,7 @@ use Ayacoo\RedirectTab\Service\RedirectDemandService; use PHPUnit\Framework\Attributes\Test; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Configuration\SiteConfiguration; use TYPO3\CMS\Core\Site\Entity\NullSite; @@ -24,6 +25,9 @@ final class RedirectDemandServiceTest extends FunctionalTestCase protected function setUp(): void { parent::setUp(); + $backendUserAuthentication = $this->createMock(BackendUserAuthentication::class); + $backendUserAuthentication->method('isAdmin')->withAnyParameters()->willReturn(true); + $GLOBALS['BE_USER'] = $backendUserAuthentication; $this->subject = $this->get(RedirectDemandService::class); } diff --git a/composer.json b/composer.json index b154a59..564f0e1 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "ayacoo/redirect-tab", "type": "typo3-cms-extension", - "version": "4.0.2", - "description": "Show TYPO3 redirects in the page properties", + "version": "5.0.0", + "description": "RedirectTab - Show TYPO3 redirects in the page properties", "authors": [ { "name": "Guido Schmechel", @@ -13,23 +13,22 @@ "license": "GPL-2.0-or-later", "require": { "php": ">=8.2 < 8.6", - "typo3/cms-core": "^13.4", - "typo3/cms-redirects": "^13.4" + "typo3/cms-core": "^14.3", + "typo3/cms-redirects": "^14.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.57.0", - "helmich/typo3-typoscript-lint": "^3.1.0", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "phpunit/phpunit": "^11.0.3", - "saschaegerer/phpstan-typo3": "^1.10.0", - "squizlabs/php_codesniffer": "^3.8.1", + "friendsofphp/php-cs-fixer": "^3.91", + "helmich/typo3-typoscript-lint": "^3.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", + "phpunit/phpunit": "^11.5.44", + "squizlabs/php_codesniffer": "^3.13", "symfony/console": "^7.0", "symfony/translation": "^7.0", "typo3/coding-standards": "^0.5.5", - "typo3/testing-framework": "^9.0" + "typo3/testing-framework": "^9.3" }, "autoload": { "psr-4": { @@ -49,8 +48,8 @@ } }, "scripts": { - "ci:php:cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix --dry-run -v --config ./Build/php-cs-fixer/php-cs-fixer.php ./", - "ci:php:csfix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix -v --config ./Build/php-cs-fixer/php-cs-fixer.php ./", + "ci:php:cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix --dry-run -v --config Build/php-cs-fixer/php-cs-fixer.php ./", + "ci:php:csfix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./.Build/bin/php-cs-fixer fix -v --config Build/php-cs-fixer/php-cs-fixer.php ./", "ci:php:lint": "find .*.php *.php Classes Configuration Tests -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l", "ci:php:sniff": "phpcs Classes Configuration Tests", "ci:php:stan": "phpstan --no-progress", diff --git a/ext_emconf.php b/ext_emconf.php index 8a84a9e..38a0e11 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -8,12 +8,12 @@ 'author_email' => 'info@ayacoo.de', 'state' => 'stable', 'clearCacheOnLoad' => 0, - 'version' => '4.0.2', + 'version' => '5.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '13.0.0-13.4.99', - 'redirects' => '13.0.0-13.4.99', - 'php' => '8.2.0-8.4.99', + 'typo3' => '14.3.0-14.3.99', + 'redirects' => '14.3.0-14.3.99', + 'php' => '8.2.0-8.5.99', ], 'conflicts' => [ ],