diff --git a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/bug-report.md b/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 3071f1d6e5180115013b20b5dcbc12f5990023cc..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: "\U0001F41E Bug report" -about: Tell us about a bug you may have identified. -labels: - ---- - -# Bug Report - -## Prerequisites - -* [ ] Did you reproduce the problem on TYPO3 core master? -* [ ] Did you reproduce the problem on TYPO3 v10.4 LTS? -* [ ] Did you reproduce the problem on TYPO3 v9.5 LTS? - -## Description - -[Description of the bug] - -## Steps to Reproduce - -1. [First Step] -2. [Second Step] -3. [and so on...] - -**Expected behavior:** [What you expected to happen] - -**Actual behavior:** [What actually happened] - -## Versions - -You can get this information from executing `composer show` at the command line if -your TYPO3 installation is composer based, otherwise the version number will be -shown in the extension manager. diff --git a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/feature-request.md b/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/feature-request.md deleted file mode 100644 index 9088bb84a1dbcd0137d3c5dd960aa63966e7b9f1..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/feature-request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: "\U0001F680 Feature request" -about: Suggest an idea for a new feature. -labels: - ---- - -# Feature Request - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/support.md b/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/support.md deleted file mode 100644 index 328326ea12fb8d13f2c6c8b334ebe5296f30e3b1..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/ISSUE_TEMPLATE/support.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: "⛑ Support" -about: Ask the community for help. -labels: - ---- - -# Support - -**Is your question related to a problem? Please describe.** diff --git a/typo3/sysext/styleguide/.github/workflows/publish.yml b/typo3/sysext/styleguide/.github/workflows/publish.yml deleted file mode 100644 index 515467858861c288565afca27cf01ad83a27b3e4..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/publish.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: publish - -on: - push: - tag: - -jobs: - publish: - name: Publish new version to TER - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-20.04 - env: - TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Check tag - run: | - if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then - exit 1 - fi - - - name: Get version - id: get-version - run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} - - - name: Get comment - id: get-comment - run: | - readonly local comment=$(git tag -n10 -l ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g") - echo ::set-output name=comment::$comment - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - extensions: intl, mbstring, json, zip, curl - tools: composer:v2 - - - name: Install tailor - run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest - - - name: Publish to TER - run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }} diff --git a/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-mysqli.yml b/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-mysqli.yml deleted file mode 100644 index 026aa1b79e9eda4da16d12296d1eaaf00b8a4519..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-mysqli.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: tests-ac-mariadb-mysqli - -on: - push: - pull_request: - schedule: - - cron: '42 5 * * *' - -jobs: - testsuite: - name: Acceptance tests mariadb with mysqli - runs-on: ubuntu-20.04 - strategy: - # This prevents cancellation of matrix job runs, if one or more already failed - # and let the remaining matrix jobs be executed anyway. - fail-fast: false - matrix: - php: [ '8.1', '8.2' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate - - - name: Acceptance Tests mariadb and mysqli - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s acceptance -d mariadb -a mysqli diff --git a/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-pdo-mysql.yml b/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-pdo-mysql.yml deleted file mode 100644 index bdf029532a00ad3a15733054beef60c8e990322e..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/tests-ac-mariadb-pdo-mysql.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: tests-ac-mariadb-pdo-mysql - -on: - push: - pull_request: - schedule: - - cron: '42 5 * * *' - -jobs: - testsuite: - name: Acceptance tests mariadb with pdo_mysql - runs-on: ubuntu-20.04 - strategy: - # This prevents cancellation of matrix job runs, if one or more already failed - # and let the remaining matrix jobs be executed anyway. - fail-fast: false - matrix: - php: [ '8.1', '8.2' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate - - - name: Acceptance Tests mariadb and pdo_mysql - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s acceptance -d mariadb -a pdo_mysql diff --git a/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-mysqli.yml b/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-mysqli.yml deleted file mode 100644 index b1f1179e851a024633172711adc10ae3875ba7d5..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-mysqli.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: tests-ac-mysql-mysqli - -on: - push: - pull_request: - schedule: - - cron: '42 5 * * *' - -jobs: - testsuite: - name: Acceptance tests mysql with mysqli - runs-on: ubuntu-20.04 - strategy: - # This prevents cancellation of matrix job runs, if one or more already failed - # and let the remaining matrix jobs be executed anyway. - fail-fast: false - matrix: - php: [ '8.1', '8.2' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate - - - name: Acceptance Tests mysql and mysqli - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s acceptance -d mysql -a mysqli diff --git a/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-pdo-mysql.yml b/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-pdo-mysql.yml deleted file mode 100644 index 5e77d0c5b04679896b0fa0030ab76390ad668083..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/tests-ac-mysql-pdo-mysql.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: tests-ac-mysql-pdo-mysql - -on: - push: - pull_request: - schedule: - - cron: '42 5 * * *' - -jobs: - testsuite: - name: Acceptance tests mysql with pdo_mysql - runs-on: ubuntu-20.04 - strategy: - # This prevents cancellation of matrix job runs, if one or more already failed - # and let the remaining matrix jobs be executed anyway. - fail-fast: false - matrix: - php: [ '8.1', '8.2' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate - - - name: Acceptance Tests mysql and pdo_mysql - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s acceptance -d mysql -a pdo_mysql diff --git a/typo3/sysext/styleguide/.github/workflows/tests-ac-postgres.yml b/typo3/sysext/styleguide/.github/workflows/tests-ac-postgres.yml deleted file mode 100644 index 6077a09962c473a6e8a8ee787d7ee26b4db29693..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/.github/workflows/tests-ac-postgres.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: tests-ac-postgres - -on: - push: - pull_request: - schedule: - - cron: '42 5 * * *' - -jobs: - testsuite: - name: Acceptance tests postgres - runs-on: ubuntu-20.04 - strategy: - # This prevents cancellation of matrix job runs, if one or more already failed - # and let the remaining matrix jobs be executed anyway. - fail-fast: false - matrix: - php: [ '8.1', '8.2' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerUpdate - - - name: Acceptance Tests postgres - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s acceptance -d postgres diff --git a/typo3/sysext/styleguide/.github/workflows/tests.yml b/typo3/sysext/styleguide/.github/workflows/tests.yml index 74b52d62827ecd2c333c936ae289d8ebd5c61a1f..ae828ac8eccce129a78849e4c1da449df158ba28 100644 --- a/typo3/sysext/styleguide/.github/workflows/tests.yml +++ b/typo3/sysext/styleguide/.github/workflows/tests.yml @@ -38,23 +38,5 @@ jobs: - name: Unit Tests run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s unit - - name: Functional Tests with mariadb and mysqli - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -a mysqli -s functional - - - name: Functional Tests with mariadb and pdo_mysql - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mariadb -a pdo_mysql -s functional - - - name: Functional Tests with mysql and mysqli - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mysql -a mysqli -s functional - - - name: Functional Tests with mysql and pdo_mysql - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d mysql -a pdo_mysql -s functional - - - name: Functional Tests with postgres - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d postgres -s functional - - - name: Functional Tests with sqlite - run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -d sqlite -s functional - - name: Build CSS run: Build/Scripts/runTests.sh -s buildCss diff --git a/typo3/sysext/styleguide/Build/FunctionalTests.xml b/typo3/sysext/styleguide/Build/FunctionalTests.xml deleted file mode 100644 index f086015502598ebd4f48dbd25ef369cf180a66d2..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Build/FunctionalTests.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0"?> -<phpunit - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" - backupGlobals="true" - bootstrap="FunctionalTestsBootstrap.php" - cacheResult="false" - colors="true" - beStrictAboutTestsThatDoNotTestAnything="false" - displayDetailsOnTestsThatTriggerDeprecations="true" - displayDetailsOnTestsThatTriggerErrors="true" - displayDetailsOnTestsThatTriggerNotices="true" - displayDetailsOnTestsThatTriggerWarnings="true" - failOnDeprecation="true" - failOnNotice="true" - failOnRisky="true" - failOnWarning="true" - cacheDirectory=".phpunit.cache" -> - <testsuites> - <testsuite name="Functional tests"> - <directory>../Tests/Functional/</directory> - </testsuite> - </testsuites> - <php> - <ini name="display_errors" value="1"/> - <ini name="error_reporting" value="E_ALL"/> - <env name="TYPO3_CONTEXT" value="Testing"/> - </php> -</phpunit> diff --git a/typo3/sysext/styleguide/Build/FunctionalTestsBootstrap.php b/typo3/sysext/styleguide/Build/FunctionalTestsBootstrap.php deleted file mode 100644 index 443197d707ea9439b0c3c730b857e628bdfeeeb7..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Build/FunctionalTestsBootstrap.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -call_user_func(function () { - $testbase = new \TYPO3\TestingFramework\Core\Testbase(); - $testbase->defineOriginalRootPath(); - $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); - $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient'); -}); diff --git a/typo3/sysext/styleguide/Build/Scripts/runTests.sh b/typo3/sysext/styleguide/Build/Scripts/runTests.sh index 5fa4ad7ac10c5e1779b432df590bdc586d863792..c6399e3b166e6af85dd438348a357d4d8fcc31fe 100755 --- a/typo3/sysext/styleguide/Build/Scripts/runTests.sh +++ b/typo3/sysext/styleguide/Build/Scripts/runTests.sh @@ -28,36 +28,10 @@ setUpDockerComposeDotEnv() { echo "EXTRA_TEST_OPTIONS=${EXTRA_TEST_OPTIONS}" echo "SCRIPT_VERBOSE=${SCRIPT_VERBOSE}" echo "CGLCHECK_DRY_RUN=${CGLCHECK_DRY_RUN}" - echo "DATABASE_DRIVER=${DATABASE_DRIVER}" - echo "DOCKER_SELENIUM_IMAGE=${DOCKER_SELENIUM_IMAGE}" echo "IMAGE_PREFIX=${IMAGE_PREFIX}" } > .env } -# Options -a and -d depend on each other. The function -# validates input combinations and sets defaults. -handleDbmsAndDriverOptions() { - case ${DBMS} in - mysql|mariadb) - [ -z "${DATABASE_DRIVER}" ] && DATABASE_DRIVER="mysqli" - if [ "${DATABASE_DRIVER}" != "mysqli" ] && [ "${DATABASE_DRIVER}" != "pdo_mysql" ]; then - echo "Invalid option -a ${DATABASE_DRIVER} with -d ${DBMS}" >&2 - echo >&2 - echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 - exit 1 - fi - ;; - postgres|sqlite) - if [ -n "${DATABASE_DRIVER}" ]; then - echo "Invalid option -a ${DATABASE_DRIVER} with -d ${DBMS}" >&2 - echo >&2 - echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 - exit 1 - fi - ;; - esac -} - # Load help text into $HELP read -r -d '' HELP <<EOF styleguide test runner. Execute unit test suite and some other details. @@ -70,50 +44,26 @@ No arguments: Run all unit tests with PHP 8.1 Options: -s <...> Specifies which test suite to run - - acceptance: backend acceptance tests - buildCss: compile CSS from SCSS - cgl: cgl test and fix all php files - clean: clean up test related build files - composerUpdate: "composer update", handy if host has no PHP - composerValidate: "composer validate" - - functional: functional tests - lint: PHP linting - phpstan: phpstan analyze - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - -a <mysqli|pdo_mysql> - Only with -s acceptance,functional - Specifies to use another driver, following combinations are available: - - mysql - - mysqli (default) - - pdo_mysql - - mariadb - - mysqli (default) - - pdo_mysql - - -d <mariadb|mysql|postgres|sqlite> - Only with -s acceptance,functional - Specifies on which DBMS tests are performed - - mariadb (default): use mariadb - - mysql: use mysql - - postgres: use postgres - - sqlite: use sqlite (not for -s acceptance) - -p <8.1|8.2> Specifies the PHP minor version to be used - 8.1 (default): use PHP 8.1 - 8.2: use PHP 8.2 - -e "<phpunit, codeception or additional phpstan scan options>" - Only with -s acceptance|functional|unit - Additional options to send to phpunit (unit & functional tests) or codeception (acceptance - tests). For phpunit, options starting with "--" must be added after options starting with "-". - Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests - named "canRetrieveValueWithGP" + -e "<phpunit or additional phpstan scan options>" + Additional options to send to phpunit (unit). -x - Only with -s functional|unit|acceptance + Only with -s unit Send information to host instance for test or system under test break points. This is especially useful if a local PhpStorm instance is listening on default xdebug port 9003. A different port can be selected with -y @@ -126,12 +76,6 @@ Options: Only with -s cgl Activate dry-run in CGL check that does not actively change files and only prints broken ones. - -u - Update existing typo3/core-testing-*:latest docker images. Maintenance call to docker pull latest - versions of the main php images. The images are updated once in a while and only the youngest - ones are supported by core testing. Use this if weird test errors occur. Also removes obsolete - image versions of typo3/core-testing-*. - -v Enable verbose script output. Shows variables and docker commands. @@ -165,26 +109,14 @@ else ROOT_DIR=`realpath ${PWD}/../../` fi TEST_SUITE="unit" -DBMS="mariadb" PHP_VERSION="8.1" PHP_XDEBUG_ON=0 PHP_XDEBUG_PORT=9003 EXTRA_TEST_OPTIONS="" SCRIPT_VERBOSE=0 CGLCHECK_DRY_RUN="" -DATABASE_DRIVER="" -DOCKER_SELENIUM_IMAGE="selenium/standalone-chrome:3.141.59-20210713" IMAGE_PREFIX="ghcr.io/typo3/" -# Detect arm64 and use a seleniarm image. -# In a perfect world selenium would have a arm64 integrated, but that is not on the horizon. -# So for the time being we have to use seleniarm image. -ARCH=$(uname -m) -if [ $ARCH = "arm64" ]; then - DOCKER_SELENIUM_IMAGE="seleniarm/standalone-chromium:4.1.2-20220227" - echo "Architecture" $ARCH "requires" $DOCKER_SELENIUM_IMAGE "to run acceptance tests." -fi - # Option parsing # Reset in case getopts has been used previously in the shell OPTIND=1 @@ -196,12 +128,6 @@ while getopts ":s:a:d:p:e:xy:nhuv" OPT; do s) TEST_SUITE=${OPTARG} ;; - a) - DATABASE_DRIVER=${OPTARG} - ;; - d) - DBMS=${OPTARG} - ;; p) PHP_VERSION=${OPTARG} ;; @@ -221,9 +147,6 @@ while getopts ":s:a:d:p:e:xy:nhuv" OPT; do n) CGLCHECK_DRY_RUN="-n" ;; - u) - TEST_SUITE=update - ;; v) SCRIPT_VERBOSE=1 ;; @@ -260,32 +183,6 @@ fi # Suite execution case ${TEST_SUITE} in - acceptance) - handleDbmsAndDriverOptions - setUpDockerComposeDotEnv - case ${DBMS} in - mysql) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run acceptance_backend_mysql80 - SUITE_EXIT_CODE=$? - ;; - mariadb) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run acceptance_backend_mariadb10 - SUITE_EXIT_CODE=$? - ;; - postgres) - docker-compose run acceptance_backend_postgres10 - SUITE_EXIT_CODE=$? - ;; - *) - echo "Acceptance tests don't run with DBMS ${DBMS}" >&2 - echo >&2 - echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2 - exit 1 - esac - docker-compose down - ;; buildCss) setUpDockerComposeDotEnv docker-compose run build_css @@ -322,41 +219,6 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? docker-compose down ;; - functional) - handleDbmsAndDriverOptions - setUpDockerComposeDotEnv - case ${DBMS} in - mariadb) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run functional_mariadb10 - SUITE_EXIT_CODE=$? - ;; - mysql) - echo "Using driver: ${DATABASE_DRIVER}" - docker-compose run functional_mysql80 - SUITE_EXIT_CODE=$? - ;; - postgres) - docker-compose run functional_postgres10 - SUITE_EXIT_CODE=$? - ;; - sqlite) - # sqlite has a tmpfs as .Build/Web/typo3temp/var/tests/functional-sqlite-dbs/ - # Since docker is executed as root (yay!), the path to this dir is owned by - # root if docker creates it. Thank you, docker. We create the path beforehand - # to avoid permission issues. - mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/ - docker-compose run functional_sqlite - SUITE_EXIT_CODE=$? - ;; - *) - echo "Invalid -d option argument ${DBMS}" >&2 - echo >&2 - echo "${HELP}" >&2 - exit 1 - esac - docker-compose down - ;; lint) setUpDockerComposeDotEnv docker-compose run lint @@ -381,12 +243,6 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? docker-compose down ;; - update) - # pull typo3/core-testing-*:latest versions of those ones that exist locally - docker images ${IMAGE_PREFIX}core-testing-*:latest --format "{{.Repository}}:latest" | xargs -I {} docker pull {} - # remove "dangling" typo3/core-testing-* images (those tagged as <none>) - docker images ${IMAGE_PREFIX}core-testing-* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} docker rmi {} - ;; *) echo "Invalid -s option argument ${TEST_SUITE}" >&2 echo >&2 diff --git a/typo3/sysext/styleguide/Build/testing-docker/docker-compose.yml b/typo3/sysext/styleguide/Build/testing-docker/docker-compose.yml index 64ff61352b6dfb7c52a9323600a4a18eeb9a207a..e878c6e8845c4ffaf6925b5c1891a0b5584d6986 100644 --- a/typo3/sysext/styleguide/Build/testing-docker/docker-compose.yml +++ b/typo3/sysext/styleguide/Build/testing-docker/docker-compose.yml @@ -1,183 +1,5 @@ version: '2.3' services: - chrome: - image: ${DOCKER_SELENIUM_IMAGE} - tmpfs: - - /dev/shm:rw,nosuid,nodev,noexec,relatime - - mariadb10: - # not using mariadb:10 for the time being, because 10.5.7 (currently latest) is broken - image: mariadb:10.5.6 - environment: - MYSQL_ROOT_PASSWORD: funcp - tmpfs: - - /var/lib/mysql/:rw,noexec,nosuid - - mysql80: - image: mysql:8.0 - environment: - MYSQL_ROOT_PASSWORD: funcp - tmpfs: - - /var/lib/mysql/:rw,noexec,nosuid - - postgres10: - image: postgres:10-alpine - environment: - POSTGRES_PASSWORD: funcp - POSTGRES_USER: ${HOST_USER} - tmpfs: - - /var/lib/postgresql/data:rw,noexec,nosuid - - web: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - stop_grace_period: 1s - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - environment: - TYPO3_PATH_ROOT: ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/acceptance - TYPO3_PATH_APP: ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/acceptance - command: > - /bin/sh -c " - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - php -S web:8000 -t ${ROOT_DIR}/.Build/Web - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - php -S web:8000 -t ${ROOT_DIR}/.Build/Web - fi - " - - acceptance_backend_mariadb10: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mariadb10 - - chrome - - web - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mariadb10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mariadb10 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p .Build/Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Backend -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - $${COMMAND}; - fi - " - - acceptance_backend_mysql80: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mysql80 - - chrome - - web - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mysql80 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mysql80 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Backend -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - $${COMMAND}; - fi - " - - acceptance_backend_postgres10: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - postgres10 - - chrome - - web - environment: - typo3DatabaseDriver: pdo_pgsql - typo3DatabaseName: bamboo - typo3DatabaseUsername: ${HOST_USER} - typo3DatabaseHost: postgres10 - typo3DatabasePassword: funcp - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z postgres10 5432; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - mkdir -p Web/typo3temp/var/tests/ - COMMAND=\".Build/vendor/codeception/codeception/codecept run Backend -d -c Tests/codeception.yml ${TEST_FILE}\" - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - $${COMMAND}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - $${COMMAND}; - fi - " - build_css: image: ${IMAGE_PREFIX}core-testing-js:latest user: "${HOST_UID}" @@ -261,149 +83,6 @@ services: composer validate; " - functional_mariadb10: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mariadb10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mariadb10 - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mariadb10 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - fi - " - - functional_mysql80: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - mysql80 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: "${DATABASE_DRIVER}" - typo3DatabaseName: func_test - typo3DatabaseUsername: root - typo3DatabasePassword: funcp - typo3DatabaseHost: mysql80 - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z mysql80 3306; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}; - fi - " - - functional_postgres10: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - links: - - postgres10 - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - environment: - typo3DatabaseDriver: pdo_pgsql - typo3DatabaseName: bamboo - typo3DatabaseUsername: ${HOST_USER} - typo3DatabaseHost: postgres10 - typo3DatabasePassword: funcp - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - echo Waiting for database start...; - while ! nc -z postgres10 5432; do - sleep 1; - done; - echo Database is up; - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE}; - fi - " - - functional_sqlite: - image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest - user: "${HOST_UID}" - volumes: - - ${ROOT_DIR}:${ROOT_DIR} - tmpfs: - - ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,uid=${HOST_UID} - environment: - typo3DatabaseDriver: pdo_sqlite - working_dir: ${ROOT_DIR} - extra_hosts: - - "host.docker.internal:host-gateway" - command: > - /bin/sh -c " - if [ ${SCRIPT_VERBOSE} -eq 1 ]; then - set -x - fi - php -v | grep '^PHP'; - if [ ${PHP_XDEBUG_ON} -eq 0 ]; then - XDEBUG_MODE=\"off\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE}; - else - XDEBUG_MODE=\"debug,develop\" \ - XDEBUG_TRIGGER=\"foo\" \ - XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \ - .Build/bin/phpunit -c Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE}; - fi - " - lint: image: ${IMAGE_PREFIX}core-testing-${DOCKER_PHP_IMAGE}:latest user: "${HOST_UID}" diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Backend.suite.yml b/typo3/sysext/styleguide/Tests/Acceptance/Backend.suite.yml deleted file mode 100644 index f74923995f3a0c9c8b0d4509d305876fba823bc0..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Backend.suite.yml +++ /dev/null @@ -1,22 +0,0 @@ -actor: BackendTester -modules: - enabled: - - WebDriver: - url: http://web:8000/typo3temp/var/tests/acceptance - browser: chrome - wait: 1 - host: chrome - - \TYPO3\TestingFramework\Core\Acceptance\Helper\Acceptance - - \TYPO3\TestingFramework\Core\Acceptance\Helper\Login: - sessions: - # This sessions must exist in the database fixture to get a logged in state. - editor: ff83dfd81e20b34c27d3e97771a4525a - admin: 886526ce72b86870739cc41991144ec1 - - Asserts - -extensions: - enabled: - - TYPO3\CMS\Styleguide\Tests\Acceptance\Support\Extension\BackendStyleguideEnvironment - -groups: - AcceptanceTests-Job-*: AcceptanceTests-Job-* diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Backend/GenerateCommandCest.php b/typo3/sysext/styleguide/Tests/Acceptance/Backend/GenerateCommandCest.php deleted file mode 100644 index 3c5b631568e5382188f8caf82489a04d1c47d621..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Backend/GenerateCommandCest.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace TYPO3\CMS\Styleguide\Tests\Acceptance\Backend; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -/** - * Tests the styleguide backend module can be loaded - */ -class GenerateCommandCest -{ - protected string $command = '../../../../../bin/typo3 styleguide:generate '; - - /** - * @param \TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I - */ - public function runTcaCreateAndDelete(\TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I): void - { - $I->amGoingTo('create the TCA page tree'); - $I->runShellCommand($this->command . 'tca --create'); - $I->seeInShellOutput('TCA page tree created!'); - - $I->amGoingTo('create the TCA page tree while it already exists'); - $I->runShellCommand($this->command . 'tca --create'); - $I->seeInShellOutput('TCA page tree already exists!'); - - $I->amGoingTo('delete the TCA page tree'); - $I->runShellCommand($this->command . 'tca --delete'); - $I->seeInShellOutput('TCA page tree deleted!'); - } - - /** - * @param \TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I - */ - public function runFrontendCreateAndDelete(\TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I): void - { - $I->amGoingTo('create the frontend page tree'); - $I->runShellCommand($this->command . 'frontend --create'); - $I->seeInShellOutput('Frontend page tree created!'); - - $I->amGoingTo('create the frontend page tree while it already exists'); - $I->runShellCommand($this->command . 'frontend --create'); - $I->seeInShellOutput('Frontend page tree already exists!'); - - $I->amGoingTo('delete the frontend page tree'); - $I->runShellCommand($this->command . 'frontend --delete'); - $I->seeInShellOutput('Frontend page tree deleted!'); - } - - /** - * @param \TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I - * @depends runFrontendCreateAndDelete - * @depends runTcaCreateAndDelete - */ - public function runAllGeneratorsCreateAndDelete(\TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester $I): void - { - $I->amGoingTo('create the all page trees'); - $I->runShellCommand($this->command . 'all --create'); - $I->seeInShellOutput('TCA page tree created!'); - $I->seeInShellOutput('Frontend page tree created!'); - - $I->amGoingTo('create the all page trees while they already exists'); - $I->runShellCommand($this->command . 'all --create'); - $I->seeInShellOutput('TCA page tree already exists!'); - $I->seeInShellOutput('Frontend page tree already exists!'); - - $I->amGoingTo('delete the all demo page trees'); - $I->runShellCommand($this->command . 'all --delete'); - $I->seeInShellOutput('TCA page tree deleted!'); - $I->seeInShellOutput('Frontend page tree deleted!'); - } -} diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Backend/ModuleCest.php b/typo3/sysext/styleguide/Tests/Acceptance/Backend/ModuleCest.php deleted file mode 100644 index 760ee435f9c05fa69112d0a0698d4d6c7252d20f..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Backend/ModuleCest.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace TYPO3\CMS\Styleguide\Tests\Acceptance\Backend; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Styleguide\Tests\Acceptance\Support\BackendTester; - -/** - * Tests the styleguide backend module can be loaded - */ -class ModuleCest -{ - /** - * @param BackendTester $I - */ - public function _before(BackendTester $I) - { - $I->useExistingSession('admin', 1); - $I->canSee('Styleguide'); - $I->click('Styleguide'); - $I->switchToContentFrame(); - } - - /** - * @param BackendTester $I - */ - public function styleguideInTopbarHelpCanBeCalled(BackendTester $I): void - { - $I->see('TYPO3 CMS Backend Styleguide', 'h1'); - } - - /** - * @depends styleguideInTopbarHelpCanBeCalled - * @param BackendTester $I - */ - public function creatingTcaDemoDataWorks(BackendTester $I): void - { - $I->click('Index'); - $I->waitForText('Page tree including TCA demo records'); - $I->click('#t3-tca-pagetree-create'); - $this->seeResponse($I, 'A page tree with TCA demo records was created.'); - } - - /** - * @depends creatingTcaDemoDataWorks - * @param BackendTester $I - */ - public function deletingTcaDemoDataWorks(BackendTester $I): void - { - $I->click('Index'); - $I->waitForText('Page tree including TCA demo records'); - $I->click('#t3-tca-pagetree-delete'); - $this->seeResponse($I, 'The page tree and all related records were deleted.'); - } - - /** - * @depends styleguideInTopbarHelpCanBeCalled - * @param BackendTester $I - */ - public function creatingFrontendDemoDataWorks(BackendTester $I): void - { - $I->click('Index'); - $I->waitForText('Page tree including content elements'); - $I->click('#t3-ce-pagetree-create'); - $this->seeResponse($I, 'A page tree with content elements was created.'); - } - - /** - * @depends creatingTcaDemoDataWorks - * @param BackendTester $I - */ - public function deletingFrontendDemoDataWorks(BackendTester $I): void - { - $I->click('Index'); - $I->waitForText('Page tree including content elements'); - $I->click('#t3-ce-pagetree-delete'); - $this->seeResponse($I, 'The page tree and all related records were deleted.'); - } - - private function seeResponse(BackendTester $I, string $message): void - { - $I->seeElement('.t3js-generator-action .icon-spinner-circle'); - $I->switchToMainFrame(); - $I->waitForText($message, 60, '.alert-message'); - $I->switchToContentFrame(); - $I->dontSeeElement('.t3js-generator-action .icon-spinner-circle'); - } -} diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Fixtures/BackendStyleguideEnvironment.csv b/typo3/sysext/styleguide/Tests/Acceptance/Fixtures/BackendStyleguideEnvironment.csv deleted file mode 100644 index 165b4d1cc6ab8079838022e7d177f696c9c45fd9..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Fixtures/BackendStyleguideEnvironment.csv +++ /dev/null @@ -1,14 +0,0 @@ -"be_users" -,"uid","pid","tstamp","username","password","admin","disable","starttime","endtime","options","crdate","workspace_perms","deleted","TSconfig","lastlogin","workspace_id","db_mountpoints","usergroup","realName" -# password of both users is "password" -,1,0,1366642540,"admin","$1$tCrlLajZ$C0sikFQQ3SWaFAZ1Me0Z/1",1,0,0,0,0,1366642540,1,0,,1371033743,0,0,0,"Klaus Admin" -,2,0,1452944912,"editor","$1$tCrlLajZ$C0sikFQQ3SWaFAZ1Me0Z/1",0,0,0,0,0,1452944912,1,0,,1452944915,0,1,1,"" -"be_sessions" -,"ses_id","ses_iplock","ses_userid","ses_tstamp","ses_data" -# ses_id: hash_hmac('sha256', '886526ce72b86870739cc41991144ec1', sha1('iAmInvalid' . 'core-session-backend')) -,"9869d429fc72742a476d5073d006d45dfb732962d9c024423efafef537e1c5bd","[DISABLED]",1,1777777777,"", -,"f4c02f70058e79a8e7b523a266d4291007deacba6b2ca2536dd72d2fbb23696a","[DISABLED]",2,1777777777,"", -"be_groups" -,"uid","pid","tstamp","title","tables_modify","crdate","subgroup" -,1,0,1452959228,"editor-group","pages",1452959228, -,2,0,1452959228,"some test group","pages",1452959228,1 diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Support/BackendTester.php b/typo3/sysext/styleguide/Tests/Acceptance/Support/BackendTester.php deleted file mode 100644 index 16c9ae1632661405219ba76493313663411c67ba..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Support/BackendTester.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace TYPO3\CMS\Styleguide\Tests\Acceptance\Support; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Styleguide\Tests\Acceptance\Support\_generated\BackendTesterActions; -use TYPO3\TestingFramework\Core\Acceptance\Step\FrameSteps; - -/** - * Default backend admin or editor actor in the backend -*/ -class BackendTester extends \Codeception\Actor -{ - use BackendTesterActions; - use FrameSteps; -} diff --git a/typo3/sysext/styleguide/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php b/typo3/sysext/styleguide/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php deleted file mode 100644 index 4f419a8f6b24bb5a0981d9802baa93453cbdf952..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace TYPO3\CMS\Styleguide\Tests\Acceptance\Support\Extension; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; - -/** - * Load various core extensions and styleguide and call styleguide generator - */ -class BackendStyleguideEnvironment extends BackendEnvironment -{ - /** - * Load a list of core extensions and styleguide - * - * @var array - */ - protected $localConfig = [ - 'coreExtensionsToLoad' => [ - 'core', - 'extbase', - 'fluid', - 'backend', - 'install', - 'frontend', - ], - 'testExtensionsToLoad' => [ - 'typo3conf/ext/styleguide', - ], - 'csvDatabaseFixtures' => [ - __DIR__ . '/../../Fixtures/BackendStyleguideEnvironment.csv', - ], - ]; -} diff --git a/typo3/sysext/styleguide/Tests/Functional/Fixtures/be_users.csv b/typo3/sysext/styleguide/Tests/Functional/Fixtures/be_users.csv deleted file mode 100644 index a8a129e2808d30a72b02af0691d0a7362f303eda..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Functional/Fixtures/be_users.csv +++ /dev/null @@ -1,4 +0,0 @@ -"be_users" -,"uid","pid","tstamp","username","password","admin","disable","starttime","endtime","options","crdate","workspace_perms","deleted","TSconfig","lastlogin","workspace_id" -# The password is "password" -,1,0,1366642540,"admin","$1$tCrlLajZ$C0sikFQQ3SWaFAZ1Me0Z/1",1,0,0,0,0,1366642540,1,0,,1371033743,0 diff --git a/typo3/sysext/styleguide/Tests/Functional/TcaDataGenerator/GeneratorTest.php b/typo3/sysext/styleguide/Tests/Functional/TcaDataGenerator/GeneratorTest.php deleted file mode 100644 index 45240ab41161271442d82aff6a4530e39f15535a..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/Functional/TcaDataGenerator/GeneratorTest.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace TYPO3\CMS\Styleguide\Tests\Functional\TcaDataGenerator; - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -use TYPO3\CMS\Core\Core\Bootstrap; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Styleguide\TcaDataGenerator\Generator; -use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; - -final class GeneratorTest extends FunctionalTestCase -{ - /** - * @var non-empty-string[] Have styleguide loaded - */ - protected array $testExtensionsToLoad = [ - 'typo3conf/ext/styleguide', - ]; - - /** - * @test - */ - public function generatorCreatesBasicRecord(): void - { - $this->importCSVDataSet(__DIR__ . '/../Fixtures/be_users.csv'); - $this->setUpBackendUser(1); - Bootstrap::initializeLanguageObject(); - - // Verify there is no tx_styleguide_elements_basic yet - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_styleguide_elements_basic'); - $queryBuilder->getRestrictions()->removeAll(); - $count = (int)$queryBuilder->count('uid') - ->from('tx_styleguide_elements_basic') - ->executeQuery() - ->fetchOne(); - self::assertEquals(0, $count); - - $generator = new Generator(); - $generator->create(); - - // Verify there is at least one tx_styleguide_elements_basic record now - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_styleguide_elements_basic'); - $queryBuilder->getRestrictions()->removeAll(); - $count = (int)$queryBuilder->count('uid') - ->from('tx_styleguide_elements_basic') - ->where( - $queryBuilder->expr()->eq( - 'pid', - $queryBuilder->createNamedParameter($this->getPageUidFor('tx_styleguide_elements_basic'), \PDO::PARAM_INT) - ) - ) - ->executeQuery() - ->fetchOne(); - self::assertGreaterThan(0, $count); - } - - private function getPageUidFor(string $dataTable): ?int - { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) - ->getConnectionForTable('pages') - ->createQueryBuilder(); - - $row = $queryBuilder - ->select(...['uid']) - ->from('pages') - ->where( - $queryBuilder->expr()->eq( - 'tx_styleguide_containsdemo', - $queryBuilder->createNamedParameter($dataTable, \PDO::PARAM_STR) - ), - // only default language pages needed - $queryBuilder->expr()->eq( - 'sys_language_uid', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ) - ) - ->orderBy('pid', 'DESC') - // add uid as deterministic last sorting, as not all dbms in all versions do that - ->addOrderBy('uid', 'ASC') - ->executeQuery() - ->fetchAssociative(); - - if ($row['uid'] ?? false) { - return (int)$row['uid']; - } - return null; - } -} diff --git a/typo3/sysext/styleguide/Tests/codeception.yml b/typo3/sysext/styleguide/Tests/codeception.yml deleted file mode 100644 index 6b63e24ed89a6b036b86685b507fbde88d25bc27..0000000000000000000000000000000000000000 --- a/typo3/sysext/styleguide/Tests/codeception.yml +++ /dev/null @@ -1,16 +0,0 @@ -namespace: TYPO3\CMS\Styleguide\Tests\Acceptance\Support -paths: - tests: Acceptance - data: . - output: ../.Build/Web/typo3temp/var/tests/AcceptanceReports - support: Acceptance/Support -settings: - colors: true - memory_limit: 1024M -modules: - enabled: - - Codeception\Module\Cli -extensions: - enabled: - - Codeception\Extension\RunFailed - - Codeception\Extension\Recorder diff --git a/typo3/sysext/styleguide/composer.json b/typo3/sysext/styleguide/composer.json index ac6a9cf490400569e2798dbc0534fdf9af722805..c657b15166f2d9307f9c00c83d0a8ea3bfc534ea 100644 --- a/typo3/sysext/styleguide/composer.json +++ b/typo3/sysext/styleguide/composer.json @@ -2,19 +2,12 @@ "name": "typo3/cms-styleguide", "type": "typo3-cms-extension", "description": "TYPO3 extension to showcase TYPO3 Backend capabilities", - "authors": [ - { - "name": "TYPO3 CMS Core Team", - "role": "Developer", - "homepage": "https://forge.typo3.org/projects/typo3cms-core" - }, - { - "name": "The TYPO3 Community", - "role": "Contributor", - "homepage": "https://typo3.org/community/" - } - ], - "homepage": "https://github.com/TYPO3/styleguide", + "authors": [{ + "name": "TYPO3 Core Team", + "email": "typo3cms@typo3.org", + "role": "Developer" + }], + "homepage": "https://typo3.org", "license": "GPL-2.0-or-later", "keywords": [ "typo3", @@ -22,7 +15,10 @@ "style guide" ], "support": { - "issues": "https://github.com/TYPO3/styleguide/issues" + "chat": "https://typo3.org/help", + "docs": "https://docs.typo3.org", + "issues": "https://forge.typo3.org", + "source": "https://github.com/typo3/typo3" }, "autoload": { "psr-4": { @@ -40,10 +36,6 @@ } }, "require-dev": { - "codeception/codeception": "^5.0", - "codeception/module-asserts": "^3.0", - "codeception/module-cli": "^2.0", - "codeception/module-webdriver": "^4.0", "friendsofphp/php-cs-fixer": "3.37.1", "phpstan/phpstan": "^1.10.14", "typo3/cms-core": "~13.0@dev", diff --git a/typo3/sysext/styleguide/ext_emconf.php b/typo3/sysext/styleguide/ext_emconf.php index 521c4c15608980047d2fba101d0f1d475c849373..c49efbe54fb6d8190e65077f90acd41c1c8781fa 100755 --- a/typo3/sysext/styleguide/ext_emconf.php +++ b/typo3/sysext/styleguide/ext_emconf.php @@ -2,7 +2,7 @@ $EM_CONF[$_EXTKEY] = [ 'title' => 'TYPO3 CMS Backend Styleguide and Testing use cases', - 'description' => 'Presents most supported styles for TYPO3 backend modules. Mocks typography, tables, forms, buttons, flash messages and helpers. More at https://github.com/TYPO3/styleguide', + 'description' => 'TYPO3 extension to showcase TYPO3 Backend capabilities', 'category' => 'plugin', 'author' => 'TYPO3 Core Team', 'author_email' => 'typo3cms@typo3.org',