Skip to content

Commit 50ead5a

Browse files
committed
[RELEASE] Version 10.0.0 without TYPO3 v9 support
Releases: https://projekte.in2code.de/issues/45637 Resolves: https://projekte.in2code.de/issues/47175
2 parents 7a3d715 + 99f8b61 commit 50ead5a

File tree

382 files changed

+9424
-11751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+9424
-11751
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ indent_size = 4
4949
[*.xml.dist]
5050
indent_style = tab
5151
indent_size = 4
52-
continuation_indent_size = 8
52+
ij_continuation_indent_size = 8
5353

5454
[*.sql]
5555
indent_style = tab

.github/workflows/tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '27 4 * * *'
8+
9+
jobs:
10+
testsuite:
11+
name: all tests
12+
runs-on: ubuntu-20.04
13+
strategy:
14+
matrix:
15+
php: [ '7.2', '7.3', '7.4' ]
16+
minMax: [ 'composerInstallMin', 'composerInstallMax' ]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Composer
22+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s ${{ matrix.minMax }}
23+
24+
- name: Composer validate
25+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate
26+
27+
- name: Lint PHP
28+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint
29+
30+
- name: Unit tests
31+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit
32+
33+
- name: Functional tests with mariadb
34+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -s functional
35+
36+
# - name: Functional tests with mssql
37+
# run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mssql -s functional
38+
39+
# - name: Functional tests with postgres
40+
# run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional
41+
42+
# - name: Functional tests with sqlite
43+
# run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d sqlite -s functional

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ ehthumbs.db
1010
Thumbs.db
1111
.svn
1212
.sass-cache
13-
.Build
14-
composer.lock
1513

1614
Resources/Private/Clickdummy/Fonts
1715
Resources/Private/Clickdummy/typo3_src-6.2.9
1816
Resources/Private/Clickdummy/zextensions.css
1917

2018
# Generated
19+
.Build
2120
Build/testing-docker/.env
21+
Build/.phpunit.result.cache
22+
composer.lock

.travis.yml

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

Build/FunctionalTests.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<phpunit
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
backupGlobals="true"
5+
bootstrap="FunctionalTestsBootstrap.php"
6+
colors="true"
7+
convertErrorsToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
forceCoversAnnotation="false"
10+
stopOnError="false"
11+
stopOnFailure="false"
12+
stopOnIncomplete="false"
13+
stopOnSkipped="false"
14+
verbose="false"
15+
beStrictAboutTestsThatDoNotTestAnything="false"
16+
failOnWarning="true"
17+
>
18+
<testsuites>
19+
<testsuite name="Functional tests">
20+
<directory>../Tests/Functional/</directory>
21+
</testsuite>
22+
</testsuites>
23+
<php>
24+
<const name="TYPO3_MODE" value="BE" />
25+
<ini name="display_errors" value="1" />
26+
<env name="TYPO3_CONTEXT" value="Testing" />
27+
</php>
28+
</phpunit>

Build/FunctionalTestsBootstrap.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/*
3+
* This file is part of the TYPO3 CMS project.
4+
*
5+
* It is free software; you can redistribute it and/or modify it under
6+
* the terms of the GNU General Public License, either version 2
7+
* of the License, or any later version.
8+
*
9+
* For the full copyright and license information, please read the
10+
* LICENSE.txt file that was distributed with this source code.
11+
*
12+
* The TYPO3 project - inspiring people to share!
13+
*/
14+
15+
call_user_func(function () {
16+
if (!getenv('IN2PUBLISH_CONTEXT')) {
17+
putenv('IN2PUBLISH_CONTEXT=Local');
18+
}
19+
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
20+
$testbase->defineOriginalRootPath();
21+
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
22+
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');
23+
});

Build/Scripts/runTests.sh

Lines changed: 74 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ setUpDockerComposeDotEnv() {
2525
echo "TEST_FILE=${TEST_FILE}" >> .env
2626
echo "PHP_XDEBUG_ON=${PHP_XDEBUG_ON}" >> .env
2727
echo "PHP_XDEBUG_PORT=${PHP_XDEBUG_PORT}" >> .env
28+
echo "PHP_VERSION=${PHP_VERSION}" >> .env
2829
echo "DOCKER_PHP_IMAGE=${DOCKER_PHP_IMAGE}" >> .env
2930
echo "EXTRA_TEST_OPTIONS=${EXTRA_TEST_OPTIONS}" >> .env
3031
echo "SCRIPT_VERBOSE=${SCRIPT_VERBOSE}" >> .env
@@ -34,9 +35,6 @@ setUpDockerComposeDotEnv() {
3435
# Load help text into $HELP
3536
read -r -d '' HELP <<EOF
3637
in2publish_core test runner. Execute unit test suite and some other details.
37-
Also used by travis-ci for test execution.
38-
39-
Successfully tested with docker version 18.06.1-ce and docker-compose 1.21.2.
4038
4139
Usage: $0 [options] [file]
4240
@@ -45,18 +43,31 @@ No arguments: Run all unit tests with PHP 7.2
4543
Options:
4644
-s <...>
4745
Specifies which test suite to run
48-
- composerInstall: "composer install", handy if host has no PHP, uses composer cache of users home
46+
- composerInstall: "composer install"
47+
- composerInstallMax: "composer update", with no platform.php config.
48+
- composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0.
4949
- composerValidate: "composer validate"
5050
- lint: PHP linting
5151
- unit (default): PHP unit tests
52+
- functional: functional tests
53+
54+
-d <mariadb|mssql|postgres|sqlite>
55+
Only with -s functional
56+
Specifies on which DBMS tests are performed
57+
- mariadb (default): use mariadb
58+
- mssql: use mssql microsoft sql server
59+
- postgres: use postgres
60+
- sqlite: use sqlite
5261
53-
-p <7.2|7.3>
62+
-p <7.2|7.3|7.4|8.0>
5463
Specifies the PHP minor version to be used
5564
- 7.2 (default): use PHP 7.2
5665
- 7.3: use PHP 7.3
66+
- 7.4: use PHP 7.4
67+
- 8.0: use PHP 8.0
5768
5869
-e "<phpunit options>"
59-
Only with -s unit
70+
Only with -s functional|unit
6071
Additional options to send to phpunit tests.
6172
For phpunit, options starting with "--" must be added after options starting with "-".
6273
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
@@ -65,11 +76,11 @@ Options:
6576
-x
6677
Only with -s unit
6778
Send information to host instance for test or system under test break points. This is especially
68-
useful if a local PhpStorm instance is listening on default xdebug port 9000. A different port
79+
useful if a local PhpStorm instance is listening on default xdebug port 9003. A different port
6980
can be selected with -y
7081
7182
-y <port>
72-
Send xdebug information to a different port than default 9000 if an IDE like PhpStorm
83+
Send xdebug information to a different port than default 9003 if an IDE like PhpStorm
7384
is not listening on default port.
7485
7586
-u
@@ -109,9 +120,10 @@ cd ../testing-docker || exit 1
109120
# Option defaults
110121
ROOT_DIR=`readlink -f ${PWD}/../../`
111122
TEST_SUITE="unit"
123+
DBMS="mariadb"
112124
PHP_VERSION="7.2"
113125
PHP_XDEBUG_ON=0
114-
PHP_XDEBUG_PORT=9000
126+
PHP_XDEBUG_PORT=9003
115127
EXTRA_TEST_OPTIONS=""
116128
SCRIPT_VERBOSE=0
117129

@@ -121,11 +133,14 @@ OPTIND=1
121133
# Array for invalid options
122134
INVALID_OPTIONS=();
123135
# Simple option parsing based on getopts (! not getopt)
124-
while getopts ":s:p:e:xy:huv" OPT; do
136+
while getopts ":s:d:p:e:xy:huv" OPT; do
125137
case ${OPT} in
126138
s)
127139
TEST_SUITE=${OPTARG}
128140
;;
141+
d)
142+
DBMS=${OPTARG}
143+
;;
129144
p)
130145
PHP_VERSION=${OPTARG}
131146
;;
@@ -174,13 +189,7 @@ DOCKER_PHP_IMAGE=`echo "php${PHP_VERSION}" | sed -e 's/\.//'`
174189
# Set $1 to first mass argument, this is the optional test file or test directory to execute
175190
shift $((OPTIND - 1))
176191
if [ -n "${1}" ]; then
177-
TEST_FILE="public/typo3conf/ext/in2publish_core/${1}"
178-
else
179-
case ${TEST_SUITE} in
180-
unit)
181-
TEST_FILE="public/typo3conf/ext/in2publish_core/Tests/Unit"
182-
;;
183-
esac
192+
TEST_FILE="Web/typo3conf/ext/in2publish_core/${1}"
184193
fi
185194

186195
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
@@ -195,12 +204,56 @@ case ${TEST_SUITE} in
195204
SUITE_EXIT_CODE=$?
196205
docker-compose down
197206
;;
207+
composerInstallMax)
208+
setUpDockerComposeDotEnv
209+
docker-compose run composer_install_max
210+
SUITE_EXIT_CODE=$?
211+
docker-compose down
212+
;;
213+
composerInstallMin)
214+
setUpDockerComposeDotEnv
215+
docker-compose run composer_install_min
216+
SUITE_EXIT_CODE=$?
217+
docker-compose down
218+
;;
198219
composerValidate)
199220
setUpDockerComposeDotEnv
200221
docker-compose run composer_validate
201222
SUITE_EXIT_CODE=$?
202223
docker-compose down
203224
;;
225+
functional)
226+
setUpDockerComposeDotEnv
227+
case ${DBMS} in
228+
mariadb)
229+
docker-compose run functional_mariadb10
230+
SUITE_EXIT_CODE=$?
231+
;;
232+
mssql)
233+
docker-compose run functional_mssql2019latest
234+
SUITE_EXIT_CODE=$?
235+
;;
236+
postgres)
237+
docker-compose run functional_postgres10
238+
SUITE_EXIT_CODE=$?
239+
;;
240+
sqlite)
241+
# sqlite has a tmpfs as .Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
242+
# Since docker is executed as root (yay!), the path to this dir is owned by
243+
# root if docker creates it. Thank you, docker. We create the path beforehand
244+
# to avoid permission issues.
245+
mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
246+
docker-compose run functional_sqlite
247+
SUITE_EXIT_CODE=$?
248+
;;
249+
*)
250+
echo "Invalid -d option argument ${DBMS}" >&2
251+
echo >&2
252+
echo "${HELP}" >&2
253+
exit 1
254+
esac
255+
docker-compose down
256+
;;
204257
lint)
205258
setUpDockerComposeDotEnv
206259
docker-compose run lint
@@ -214,10 +267,10 @@ case ${TEST_SUITE} in
214267
docker-compose down
215268
;;
216269
update)
217-
# pull typo3gmbh/phpXY:latest versions of those ones that exist locally
218-
docker images typo3gmbh/php*:latest --format "{{.Repository}}:latest" | xargs -I {} docker pull {}
219-
# remove "dangling" typo3gmbh/phpXY images (those tagged as <none>)
220-
docker images typo3gmbh/php* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} docker rmi {}
270+
# pull typo3/core-testing-*:latest versions of those ones that exist locally
271+
docker images typo3/core-testing-*:latest --format "{{.Repository}}:latest" | xargs -I {} docker pull {}
272+
# remove "dangling" typo3/core-testing-* images (those tagged as <none>)
273+
docker images typo3/core-testing-* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} docker rmi {}
221274
;;
222275
*)
223276
echo "Invalid -s option argument ${TEST_SUITE}" >&2

Build/UnitTests.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<phpunit
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
backupGlobals="true"
5+
bootstrap="UnitTestsBootstrap.php"
6+
colors="true"
7+
convertErrorsToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
forceCoversAnnotation="false"
11+
processIsolation="false"
12+
stopOnError="false"
13+
stopOnFailure="false"
14+
stopOnIncomplete="false"
15+
stopOnSkipped="false"
16+
verbose="false"
17+
beStrictAboutTestsThatDoNotTestAnything="false"
18+
failOnWarning="true"
19+
>
20+
<testsuites>
21+
<testsuite name="Unit tests">
22+
<directory>../Tests/Unit/</directory>
23+
</testsuite>
24+
</testsuites>
25+
<php>
26+
<const name="TYPO3_MODE" value="BE" />
27+
<ini name="display_errors" value="1" />
28+
<env name="TYPO3_CONTEXT" value="Testing" />
29+
</php>
30+
</phpunit>

0 commit comments

Comments
 (0)