Skip to content
Merged
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
34 changes: 21 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches:
- main
- v3
- typo3-v14
pull_request:
permissions:
contents: read
Expand Down Expand Up @@ -35,6 +35,7 @@ jobs:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
code-quality:
name: "Code quality checks"
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -72,6 +73,7 @@ jobs:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
unit-tests:
name: "Unit tests"
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -112,15 +114,18 @@ 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: "^14.0"
php-version: "8.5"
composer-dependencies: highest
functional-tests:
name: "Functional tests"
runs-on: ubuntu-22.04
Expand All @@ -130,29 +135,32 @@ jobs:
# rest matrix jobs be executed anyway.
fail-fast: false
matrix:
php: [ '8.2', '8.3', '8.4' ]
php: [ '8.2', '8.3', '8.4', '8.5' ]
composerInstall: [ 'composerInstallHighest' ]
steps:
- name: Checkout
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 14 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional

- name: Functional Tests with mysql (min/max)
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -i 8.0 -s functional
- name: Functional Tests with mysql (max)
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 16 -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
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d sqlite -s functional
103 changes: 44 additions & 59 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)$ ]]; 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
Expand All @@ -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)$ ]]; 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
Expand All @@ -76,8 +76,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"
if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16)$ ]]; then
[ -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
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
Expand Down Expand Up @@ -151,7 +151,7 @@ restoreComposerFiles() {

loadHelp() {
# Load help text into $HELP
read -r -d '' HELP <<EOF
read -r -d '' HELP <<'EOF'
TYPO3 core test runner. Execute unit, functional and other test suites in
a container based test environment. Handles execution of single test files,
sending xdebug information to a local IDE and more.
Expand Down Expand Up @@ -200,47 +200,44 @@ Options:
-i version
Specify a specific database version
With "-d mariadb":
- 10.2 short-term, maintained until 2023-05-25 (default)
- 10.3 short-term, maintained until 2023-05-25
- 10.4 short-term, maintained until 2024-06-18
- 10.5 short-term, maintained until 2025-06-24
- 10.6 long-term, maintained until 2026-06
- 10.7 short-term, no longer maintained
- 10.8 short-term, maintained until 2023-05
- 10.9 short-term, maintained until 2023-08
- 10.10 short-term, maintained until 2023-11
- 10.11 long-term, maintained until 2028-02
- 10.11 long-term, maintained until 2028-02 (default)
- 11.0 development series
- 11.1 short-term development series
- 11.4 long-term, maintained until 2033-01
- 11.8 long-term, maintained until 2033-10
With "-d mysql":
- 5.5 unmaintained since 2018-12 (default)
- 5.6 unmaintained since 2021-02
- 5.7 maintained until 2023-10
- 8.0 maintained until 2026-04
- 8.0 long-term, maintained until 2026-04
- 8.4 long-term, maintained until 2032-30
With "-d postgres":
- 10 unmaintained since 2022-11-10 (default)
- 10 unmaintained since 2022-11-10
- 11 unmaintained since 2023-11-09
- 12 maintained until 2024-11-14
- 13 maintained until 2025-11-13
- 14 maintained until 2026-11-12
- 15 maintained until 2027-11-11
- 16 maintained until 2028-11-09
- 16 maintained until 2028-11-09 (default)
- 17 maintained until 2029-11-08
- 18 maintained until 2029-11-14

-t <11|12|13>
-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>
-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

-e "<phpunit options>"
Only with -s docsGenerate|functional|unit
Expand Down Expand Up @@ -277,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
}

Expand All @@ -313,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)
Expand Down Expand Up @@ -363,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)$ ]]; then
if ! [[ ${PHP_VERSION} =~ ^(8.2|8.3|8.4|8.5)$ ]]; then
INVALID_OPTIONS+=("-p ${OPTARG}")
fi
;;
Expand All @@ -372,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
;;
Expand Down Expand Up @@ -445,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}"
Expand Down Expand Up @@ -510,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
Expand All @@ -532,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
Expand Down Expand Up @@ -582,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[@]}"
Expand Down
2 changes: 2 additions & 0 deletions Classes/Command/UpdateMetadataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Ayacoo\Tiktok\Domain\Repository\FileRepository;
use Ayacoo\Tiktok\Helper\TiktokHelper;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -19,6 +20,7 @@
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;

#[AsCommand('tiktok:updateMetadata', 'Updates the Tiktok metadata')]
class UpdateMetadataCommand extends Command
{
protected function configure(): void
Expand Down
29 changes: 29 additions & 0 deletions Classes/EventListener/ModifyIconForResourcePropertiesListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Ayacoo\Tiktok\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent;
use TYPO3\CMS\Core\Resource\File;

/**
* Adjusts the icon for resources with mime type "video/tiktok".
*/
final class ModifyIconForResourcePropertiesListener
{
#[AsEventListener]
public function __invoke(ModifyIconForResourcePropertiesEvent $event): void
{
$resource = $event->getResource();

if (!$resource instanceof File) {
return;
}

if ($resource->getMimeType() === 'video/tiktok') {
$event->setIconIdentifier('mimetypes-media-image-tiktok');
}
}
}
4 changes: 2 additions & 2 deletions Classes/Rendering/TiktokRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException;
use TYPO3\CMS\Extbase\Configuration\Exception\NoServerRequestGivenException;

/**
* Tiktok renderer class
Expand Down Expand Up @@ -110,7 +110,7 @@ protected function getPrivacySetting(): bool
$privacy = (bool)$extSettings['privacy'] ?? false;
}
return $privacy;
} catch (InvalidConfigurationTypeException $e) {
} catch (NoServerRequestGivenException $e) {
return false;
}
}
Expand Down
Loading
Loading