Skip to content

Commit c96c199

Browse files
committed
[TASK] Enable tests for v14
1 parent 1d80405 commit c96c199

File tree

6 files changed

+79
-72
lines changed

6 files changed

+79
-72
lines changed

.github/workflows/core14.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: core 13
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
tests:
7+
name: v13
8+
runs-on: ubuntu-22.04
9+
strategy:
10+
# This prevents cancellation of matrix job runs, if one/two already failed and let the
11+
# rest matrix jobs be executed anyway.
12+
fail-fast: true
13+
matrix:
14+
php: [ '8.2', '8.3', '8.4' ]
15+
composerInstall: [ 'composerInstallLowest', 'composerInstallHighest' ]
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Install testing system
21+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s ${{ matrix.composerInstall }}
22+
23+
- name: Lint PHP
24+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s lint
25+
26+
- if: matrix.php == '8.3'
27+
name: Validate code against CGL
28+
run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s cgl -n
29+
30+
- name: Unit Tests
31+
run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -s unit
32+
33+
# - name: Functional Tests with mariadb and mysqli
34+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a mysqli -s functional
35+
#
36+
# - name: Functional Tests with mariadb and pdo_mysql
37+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional
38+
#
39+
# - name: Functional Tests with mysql and mysqli
40+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a mysqli -s functional
41+
#
42+
# - name: Functional Tests with mysql and pdo_mysql
43+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional
44+
#
45+
# - name: Functional Tests with postgres
46+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d postgres -s functional
47+
48+
# @todo disabled, due cross dbmns issues in code. Should be fixed first
49+
# - name: Functional Tests with sqlite
50+
# run: Build/Scripts/runTests.sh -t 14 -p ${{ matrix.php }} -d sqlite -s functional

Build/Scripts/runTests.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,14 @@ Options:
222222
- 15 maintained until 2027-11-11
223223
- 16 maintained until 2028-11-09
224224
225-
-t <12|13>
225+
-t <12|13|14>
226226
Only with -s composerInstall|composerInstallMin|composerInstallMax
227227
Specifies the TYPO3 CORE Version to be used
228228
- 12: use TYPO3 v12 (default)
229229
- 13: use TYPO3 v13
230+
- 14: use TYPO3 v14
230231
231-
-p <8.0|8.1|8.2|8.3|8.4>
232+
-p <8.2|8.3|8.4>
232233
Specifies the PHP minor version to be used
233234
- 8.0: use PHP 8.0 (default)
234235
- 8.1: use PHP 8.1
@@ -307,7 +308,7 @@ ROOT_DIR="${PWD}"
307308

308309
# Option defaults
309310
TEST_SUITE=""
310-
TYPO3_VERSION="12"
311+
TYPO3_VERSION="13"
311312
DBMS="mysql"
312313
DBMS_VERSION=""
313314
PHP_VERSION="8.2"
@@ -366,7 +367,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do
366367
;;
367368
t)
368369
TYPO3_VERSION=${OPTARG}
369-
if ! [[ ${TYPO3_VERSION} =~ ^(12|13)$ ]]; then
370+
if ! [[ ${TYPO3_VERSION} =~ ^(12|13|14)$ ]]; then
370371
INVALID_OPTIONS+=("-t ${OPTARG}")
371372
fi
372373
;;
@@ -512,6 +513,15 @@ case ${TEST_SUITE} in
512513
composer require --no-ansi --no-interaction --no-progress --no-install \
513514
typo3/cms-core:^13.4 || exit 1
514515
fi
516+
if [ ${TYPO3_VERSION} -eq 14 ]; then
517+
composer config minimum-stability dev
518+
composer require --no-ansi --no-interaction --no-progress --no-install \
519+
typo3/cms-core:dev-main \
520+
typo3/cms-install:dev-main \
521+
typo3/testing-framework:dev-main \
522+
phpunit/phpunit:^11 \
523+
|| exit 1
524+
fi
515525
composer update --no-progress --no-interaction || exit 1
516526
composer show || exit 1
517527
"
@@ -528,7 +538,11 @@ case ${TEST_SUITE} in
528538
fi
529539
if [ ${TYPO3_VERSION} -eq 13 ]; then
530540
composer require --no-ansi --no-interaction --no-progress --no-install \
531-
typo3/cms-core:^13.4 || exit 1
541+
typo3/cms-core:^13.4.17 || exit 1
542+
fi
543+
if [ ${TYPO3_VERSION} -eq 14 ]; then
544+
composer require --no-ansi --no-interaction --no-progress --no-install \
545+
typo3/cms-core:dev-main || exit 1
532546
fi
533547
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest || exit 1
534548
composer show || exit 1

Tests/Unit/Controller/AddressControllerPaginationTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@
1313
use FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand;
1414
use FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Settings;
1515
use FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository;
16+
use TYPO3\CMS\Core\Information\Typo3Version;
1617
use TYPO3\CMS\Core\Pagination\PaginatorInterface;
1718
use TYPO3\CMS\Core\Pagination\SimplePagination;
1819
use TYPO3\CMS\Extbase\Mvc\Request;
20+
use TYPO3\CMS\Fluid\View\FluidViewAdapter;
1921
use TYPO3\CMS\Fluid\View\TemplateView;
2022
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
2123
use TYPO3\TestingFramework\Core\BaseTestCase;
2224

2325
class AddressControllerPaginationTest extends BaseTestCase
2426
{
25-
protected function setUp(): void
26-
{
27-
$GLOBALS['TSFE'] = $this->getAccessibleMock(TypoScriptFrontendController::class, ['addCacheTags'], [], '', false);
28-
}
2927

3028
/**
3129
* @test
@@ -67,7 +65,7 @@ public function listActionUsesNewPaginationWithArrayRecords()
6765
$mockedRequest->expects(self::once())->method('getArgument')->with('currentPage')->willReturn(2);
6866
$mockedRequest->expects(self::any())->method('getAttribute')->willReturn([]);
6967

70-
$mockedView = $this->getAccessibleMock(TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
68+
$mockedView = $this->getAccessibleMock((new Typo3Version())->getMajorVersion() >= 14 ? FluidViewAdapter::class : TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
7169
$mockedView->expects(self::once())->method('assignMultiple')->with($assignments);
7270

7371
$subject = $this->getAccessibleMock(AddressController::class, ['createDemandFromSettings', 'htmlResponse'], [], '', false);

Tests/Unit/Controller/AddressControllerTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
use TYPO3\CMS\Core\Cache\CacheDataCollectorInterface;
2020
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
2121
use TYPO3\CMS\Core\Http\ServerRequest;
22+
use TYPO3\CMS\Core\Information\Typo3Version;
2223
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
2324
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
2425
use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters;
2526
use TYPO3\CMS\Extbase\Mvc\Request;
27+
use TYPO3\CMS\Fluid\View\FluidViewAdapter;
2628
use TYPO3\CMS\Fluid\View\TemplateView;
2729
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
2830
use TYPO3\TestingFramework\Core\BaseTestCase;
@@ -202,7 +204,7 @@ public function showActionFillsView()
202204
'address' => $address,
203205
'contentObjectData' => [],
204206
];
205-
$mockedView = $this->getAccessibleMock(TemplateView::class, ['assignMultiple'], [], '', false);
207+
$mockedView = $this->getAccessibleMock((new Typo3Version())->getMajorVersion() >= 14 ? FluidViewAdapter::class : TemplateView::class, ['assignMultiple'], [], '', false);
206208
$mockedView->expects(self::once())->method('assignMultiple')->with($assigned);
207209

208210
$subject = $this->getAccessibleMock(AddressController::class, ['redirectToUri', 'htmlResponse'], [], '', false);
@@ -235,7 +237,7 @@ public function listActionFillsViewForSingleRecords()
235237
'contentObjectData' => [],
236238
];
237239

238-
$mockedView = $this->getAccessibleMock(TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
240+
$mockedView = $this->getAccessibleMock((new Typo3Version())->getMajorVersion() >= 14 ? FluidViewAdapter::class : TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
239241
$mockedView->expects(self::once())->method('assignMultiple')->with($assignments);
240242
$mockedRequest = $this->getAccessibleMock(Request::class, ['hasArgument', 'getArgument', 'getAttribute'], [], '', false);
241243
$mockedRequest->expects(self::any())->method('getAttribute')->willReturn([]);
@@ -275,7 +277,7 @@ public function listActionFillsViewForDemand()
275277
$mockedRequest = $this->getAccessibleMock(Request::class, ['hasArgument', 'getArgument', 'getAttribute'], [], '', false);
276278
$mockedRequest->expects(self::any())->method('getAttribute')->willReturn([]);
277279

278-
$mockedView = $this->getAccessibleMock(TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
280+
$mockedView = $this->getAccessibleMock((new Typo3Version())->getMajorVersion() >= 14 ? FluidViewAdapter::class : TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
279281
$mockedView->expects(self::once())->method('assignMultiple')->with($assignments);
280282

281283
$subject = $this->getAccessibleMock(AddressController::class, ['createDemandFromSettings', 'htmlResponse'], [], '', false);
@@ -298,7 +300,7 @@ public function overrideDemandMethodIsCalledIfEnabled()
298300
$mockedRequest = $this->getAccessibleMock(Request::class, ['hasArgument', 'getArgument', 'getAttribute'], [], '', false);
299301
$mockedRepository = $this->getAccessibleMock(AddressRepository::class, ['getAddressesByCustomSorting', 'findByDemand'], [], '', false);
300302
$mockedRepository->expects(self::any())->method('findByDemand')->willReturn([]);
301-
$mockedView = $this->getAccessibleMock(TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
303+
$mockedView = $this->getAccessibleMock((new Typo3Version())->getMajorVersion() >= 14 ? FluidViewAdapter::class : TemplateView::class, ['assignMultiple', 'assign'], [], '', false);
302304
$mockedView->expects(self::once())->method('assignMultiple');
303305
$mockContentObject = $this->createMock(ContentObjectRenderer::class);
304306
$mockConfigurationManager = $this->createMock(ConfigurationManager::class);

Tests/UnitDeprecated/FormEngine/FieldControl/LocationMapWizardTest.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"license": "GPL-2.0-or-later",
2323
"require": {
2424
"typo3/cms-core": "^13.4.20 || ^14.0",
25+
"typo3/cms-install": "^13.4.20 || ^14.0",
2526
"php": ">=8.2",
2627
"symfony/console": "^6.0 || ^7.0"
2728
},
@@ -43,7 +44,6 @@
4344
}
4445
},
4546
"require-dev": {
46-
"typo3/cms-install": "^13.4.20 || ^14.0",
4747
"typo3/testing-framework": "^8.0.9",
4848
"phpunit/phpunit": "^10.5.45",
4949
"typo3/coding-standards": "^0.5.3",

0 commit comments

Comments
 (0)