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
28 changes: 14 additions & 14 deletions .github/workflows/core13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:
- name: Unit Tests
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s unit

# - name: Functional Tests with mariadb and mysqli
# run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -a mysqli -s functional
#
# - name: Functional Tests with mariadb and pdo_mysql
# run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional
#
# - name: Functional Tests with mysql and mysqli
# run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -a mysqli -s functional
#
# - name: Functional Tests with mysql and pdo_mysql
# run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional
#
# - name: Functional Tests with postgres
# run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -s functional
- name: Functional Tests with mariadb and mysqli
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -a mysqli -s functional

- name: Functional Tests with mariadb and pdo_mysql
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional

- name: Functional Tests with mysql and mysqli
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -a mysqli -s functional

- name: Functional Tests with mysql and pdo_mysql
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional

- name: Functional Tests with postgres
run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -d postgres -s functional

# @todo disabled, due cross dbmns issues in code. Should be fixed first
# - name: Functional Tests with sqlite
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/core14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:
- name: Unit Tests
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s unit

# - name: Functional Tests with mariadb and mysqli
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a mysqli -s functional
#
# - name: Functional Tests with mariadb and pdo_mysql
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional
#
# - name: Functional Tests with mysql and mysqli
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a mysqli -s functional
#
# - name: Functional Tests with mysql and pdo_mysql
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional
#
# - name: Functional Tests with postgres
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -s functional
- name: Functional Tests with mariadb and mysqli
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a mysqli -s functional

- name: Functional Tests with mariadb and pdo_mysql
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional

- name: Functional Tests with mysql and mysqli
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a mysqli -s functional

- name: Functional Tests with mysql and pdo_mysql
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional

- name: Functional Tests with postgres
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -s functional

# @todo disabled, due cross dbmns issues in code. Should be fixed first
# - name: Functional Tests with sqlite
Expand Down
64 changes: 37 additions & 27 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Options:
- composerInstallHighest: "composer update", handy if host has no PHP
- coveralls: Generate coverage
- docsGenerate: Renders the extension ReST documentation.
- rector: Run rector
- fractor: Run Fractor
- functional: functional tests
- lint: PHP linting
- unit: PHP unit tests
Expand Down Expand Up @@ -222,20 +224,18 @@ Options:
- 15 maintained until 2027-11-11
- 16 maintained until 2028-11-09

-t <12|13|14>
-t <13|14>
Only with -s composerInstall|composerInstallMin|composerInstallMax
Specifies the TYPO3 CORE Version to be used
- 12: use TYPO3 v12 (default)
- 13: use TYPO3 v13
- 13: use TYPO3 v13 (default)
- 14: use TYPO3 v14

-p <8.2|8.3|8.4>
-p <8.2|8.3|8.4|8.5>
Specifies the PHP minor version to be used
- 8.0: use PHP 8.0 (default)
- 8.1: use PHP 8.1
- 8.2: use PHP 8.2
- 8.3: use PHP 8.3
- 8.4: use PHP 8.4
- 8.5: use PHP 8.5

-e "<phpunit options>"
Only with -s docsGenerate|functional|unit
Expand All @@ -260,7 +260,7 @@ Options:
is not listening on default port.

-n
Only with -s cgl|composerNormalize
Only with -s cgl|composerNormalize|fractor
Activate dry-run in CGL check that does not actively change files and only prints broken ones.

-u
Expand All @@ -272,14 +272,14 @@ Options:
Show this help.

Examples:
# Run all core unit tests using PHP 7.4
# Run all core unit tests
./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.2 and filter for test canRetrieveValueWithGP
./Build/Scripts/runTests.sh -x -p 8.2 -- --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
Expand Down Expand Up @@ -309,22 +309,22 @@ ROOT_DIR="${PWD}"
# Option defaults
TEST_SUITE=""
TYPO3_VERSION="13"
DBMS="mysql"
DBMS="sqlite"
DBMS_VERSION=""
PHP_VERSION="8.2"
PHP_XDEBUG_ON=0
PHP_XDEBUG_PORT=9003
EXTRA_TEST_OPTIONS=""
CGLCHECK_DRY_RUN=0
DRY_RUN=0
DATABASE_DRIVER=""
CONTAINER_BIN=""
COMPOSER_ROOT_VERSION="12.0.0-dev"
COMPOSER_ROOT_VERSION="13.0.0-dev"
CONTAINER_INTERACTIVE="-it --init"
HOST_UID=$(id -u)
HOST_PID=$(id -g)
USERSET=""
SUFFIX=$(echo $RANDOM)
NETWORK="friendsoftypo3-tea-${SUFFIX}"
NETWORK="friendsoftypo3-ttaddress-${SUFFIX}"
CI_PARAMS="${CI_PARAMS:-}"
CONTAINER_HOST="host.docker.internal"
PHPSTAN_CONFIG_FILE="phpstan.neon"
Expand Down Expand Up @@ -358,7 +358,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
;;
p)
PHP_VERSION=${OPTARG}
if ! [[ ${PHP_VERSION} =~ ^(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 @@ -367,7 +367,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
;;
t)
TYPO3_VERSION=${OPTARG}
if ! [[ ${TYPO3_VERSION} =~ ^(12|13|14)$ ]]; then
if ! [[ ${TYPO3_VERSION} =~ ^(13|14)$ ]]; then
INVALID_OPTIONS+=("-t ${OPTARG}")
fi
;;
Expand All @@ -378,7 +378,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
PHP_XDEBUG_PORT=${OPTARG}
;;
n)
CGLCHECK_DRY_RUN=1
DRY_RUN=1
;;
h)
loadHelp
Expand Down Expand Up @@ -471,7 +471,7 @@ fi
case ${TEST_SUITE} in
cgl)
DRY_RUN_OPTIONS=''
if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then
if [ "${DRY_RUN}" -eq 1 ]; then
DRY_RUN_OPTIONS='--dry-run --diff'
fi
COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v ${DRY_RUN_OPTIONS} --config=Build/php-cs-fixer/php-cs-fixer.php --using-cache=no"
Expand Down Expand Up @@ -505,10 +505,6 @@ 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 12 ]; then
composer require --no-ansi --no-interaction --no-progress --no-install \
typo3/cms-core:^12.4.28 || 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
Expand All @@ -532,13 +528,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 12 ]; then
composer require --no-ansi --no-interaction --no-progress --no-install \
typo3/cms-core:^12.4.28 || exit 1
fi
if [ ${TYPO3_VERSION} -eq 13 ]; then
composer require --no-ansi --no-interaction --no-progress --no-install \
typo3/cms-core:^13.4.17 || exit 1
typo3/cms-core:^13.4.20 || exit 1
fi
if [ ${TYPO3_VERSION} -eq 14 ]; then
composer config minimum-stability dev
Expand Down Expand Up @@ -607,6 +599,24 @@ case ${TEST_SUITE} in
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/bash -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
rector)
DRY_RUN_OPTIONS=''
if [ "${DRY_RUN}" -eq 1 ]; then
DRY_RUN_OPTIONS='--dry-run'
fi
COMMAND="php -dxdebug.mode=off .Build/bin/rector process ${DRY_RUN_OPTIONS} --config=Build/rector/rector.php --no-progress-bar --ansi"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
fractor)
DRY_RUN_OPTIONS=''
if [ "${DRY_RUN}" -eq 1 ]; then
DRY_RUN_OPTIONS='--dry-run'
fi
COMMAND="php -dxdebug.mode=off .Build/bin/fractor process ${DRY_RUN_OPTIONS} --config=Build/fractor/fractor.php --ansi"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
unit)
COMMAND=(.Build/bin/phpunit -c Build/phpunit/UnitTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} "${COMMAND[@]}"
Expand Down
4 changes: 3 additions & 1 deletion Build/phpunit/FunctionalTestsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\TestingFramework\Core\Testbase;

/**
* Boilerplate for a functional test phpunit boostrap file.
*
Expand All @@ -24,7 +26,7 @@
* before instantiating the test suites.
*/
(static function () {
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
$testbase = new Testbase();
$testbase->defineOriginalRootPath();
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/AddressRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function createDemandQuery(Demand $demand): QueryInterface
}

$constraints = [];
$pages = $demand->getPages();
$pages = array_map('intval', array_filter($demand->getPages(), 'is_numeric'));
if (!empty($pages)) {
$constraints['pages'] = $query->in('pid', $pages);
}
Expand Down Expand Up @@ -109,7 +109,7 @@ public function getSqlQuery(Demand $demand): string
$params = [];
foreach ($queryParameters as $key => $value) {
// prefix array keys with ':'
$params[':' . $key] = (\is_numeric($value)) ? $value : "'" . $value . "'"; // all non numeric values have to be quoted
$params[':' . $key] = "'" . $value . "'";
unset($params[$key]);
}
// replace placeholders with real values
Expand Down
8 changes: 4 additions & 4 deletions Classes/FormEngine/TtAddressPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ protected function enrichRow(array $row): array
$records = $this->getRecords($fieldConfiguration['table'], $settings['settings'][$fieldName]);

if ($fieldConfiguration['multiValue']) {
$row['_computed'][$fieldName] = $records;
$row['computed'][$fieldName] = $records;
} else {
$row['_computed'][$fieldName] = $records[0] ?: [];
$row['computed'][$fieldName] = $records[0] ?: [];
}
}
}
$row['_computed']['lll'] = 'LLL:EXT:tt_address/Resources/Private/Language/ff/locallang_ff.xlf:pi1_flexform.';
$row['computed']['lll'] = 'LLL:EXT:tt_address/Resources/Private/Language/ff/locallang_ff.xlf:pi1_flexform.';
return $row;
}

Expand All @@ -108,7 +108,7 @@ protected function getRecords(string $table, string $idList): array
->fetchAllAssociative();

foreach ($rows as &$row) {
$row['_computed']['title'] = BackendUtility::getRecordTitle($table, $row);
$row['computed']['title'] = BackendUtility::getRecordTitle($table, $row);
}
return $rows;
}
Expand Down
5 changes: 5 additions & 0 deletions Configuration/TCA/Overrides/tt_address.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() >= 14) {
unset($GLOBALS['TCA']['tt_address']['ctrl']['searchFields']);
}
37 changes: 24 additions & 13 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

defined('TYPO3') or die;

$pluginSignature = \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'tt_address',
'ListView',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_title',
'tt-address-plugin',
'plugins',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_description'
);

$GLOBALS['TCA']['tt_content']['types'][$pluginSignature]['previewRenderer'] = \FriendsOfTYPO3\TtAddress\FormEngine\TtAddressPreviewRenderer::class;
if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() >= 14) {
$pluginSignature = \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'tt_address',
'ListView',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_title',
'tt-address-plugin',
'plugins',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_description',
'FILE:EXT:tt_address/Configuration/FlexForms/List.xml'
);
} else {
$pluginSignature = \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'tt_address',
'ListView',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_title',
'tt-address-plugin',
'plugins',
'LLL:EXT:tt_address/Resources/Private/Language/db/locallang.xlf:extbase_description'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:tt_address/Configuration/FlexForms/List.xml', $pluginSignature);
}

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'select_key,pages,recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:tt_address/Configuration/FlexForms/List.xml', $pluginSignature);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.plugin, pi_flexform',
$pluginSignature,
'after:palette:headers'
);

$GLOBALS['TCA']['tt_content']['types'][$pluginSignature]['previewRenderer'] = \FriendsOfTYPO3\TtAddress\FormEngine\TtAddressPreviewRenderer::class;

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tt_address');
Loading