From dccf8031858d700e20f297f09548fe298fc82868 Mon Sep 17 00:00:00 2001 From: Matthijs Van Assche Date: Mon, 7 Dec 2020 10:36:32 +0100 Subject: [PATCH 01/19] BW-143: Add QA package and prepare for Drupal 9 --- .codeclimate.yml | 8 ++++--- .gitignore | 15 +++---------- .travis.yml | 46 ++++++++++++++++++++++++++++++------- composer.json | 46 +++++++++++++++++++------------------ dg_cookiebot.module | 21 ----------------- grumphp.yml.dist | 30 ------------------------- phpcs-ruleset.xml.dist | 20 ----------------- phpcs.xml | 12 ---------- phpmd.xml | 25 --------------------- phpunit-coverage.xml | 51 ------------------------------------------ phpunit.xml.dist | 46 ------------------------------------- 11 files changed, 70 insertions(+), 250 deletions(-) delete mode 100644 grumphp.yml.dist delete mode 100644 phpcs-ruleset.xml.dist delete mode 100644 phpcs.xml delete mode 100644 phpmd.xml delete mode 100644 phpunit-coverage.xml delete mode 100644 phpunit.xml.dist diff --git a/.codeclimate.yml b/.codeclimate.yml index e91a3e0..d928dcf 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -2,14 +2,16 @@ version: "2" prepare: fetch: - - url: "https://raw.githubusercontent.com/digipolisgent/ci_config-files-and-scripts/master/php/drupal8/.phpmd.xml" - path: ".phpmd.xml" - url: "https://raw.githubusercontent.com/digipolisgent/ci_config-files-and-scripts/master/php/drupal8/.csslintrc" path: ".csslintrc" - url: "https://raw.githubusercontent.com/digipolisgent/ci_config-files-and-scripts/master/php/drupal8/.eslintrc.json" path: ".eslintrc.json" - url: "https://raw.githubusercontent.com/digipolisgent/ci_config-files-and-scripts/master/php/drupal8/.eslintignore" path: ".eslintignore" + - url: "https://raw.githubusercontent.com/digipolisgent/php_package_qa-drupal/1.x/configs/phpcs.xml" + path: ".phpcs.xml" + - url: "https://raw.githubusercontent.com/digipolisgent/php_package_qa-drupal/1.x/configs/phpmd.xml" + path: ".phpmd.xml" checks: argument-count: @@ -46,7 +48,7 @@ plugins: phpcodesniffer: enabled: true config: - standard: "phpcs.xml" + standard: ".phpcs.xml" phpmd: enabled: true config: diff --git a/.gitignore b/.gitignore index cd5eb3a..d29ce55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,4 @@ -# Ignore the module lock file. -/composer.lock - -# Ignore vendor directories. -/vendor -/node_modules - -# Ignore build artifacts. -/build +/build/ +/vendor/ /.phpunit.result.cache - -# Ignore binary translation files. -*.mo +/composer.lock diff --git a/.travis.yml b/.travis.yml index 27ae373..0c9f388 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,59 @@ +dist: bionic language: php sudo: false php: - - 7.2 - 7.3 + - 7.4 cache: directories: - $HOME/.composer/cache +env: + - DRUPAL=8.9 PHPUNIT=7.5 + - DRUPAL=9.0 PHPUNIT=8.5 + - DRUPAL=9.1 PHPUNIT=8.5 + +jobs: + fast_finish: true + allow_failures: + - php: 7.4 + before_install: - # Tweak composer. - - composer config github-oauth.github.com ${GITHUB_TOKEN} - - composer global require "hirak/prestissimo:^0.3" + # Configure the authentication mechanisms. + - composer config -ga github-oauth.github.com $GITHUB_TOKEN + - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN - # Get the CodeClimate test reporter. + # Require Drupal core. + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT + + # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build install: - - COMPOSER_MEMORY_LIMIT=-1 composer install + - export COMPOSER_MEMORY_LIMIT=-1 + - composer install -n script: - - vendor/bin/grumphp run + - vendor/bin/grumphp run -n after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + # Run the Code Climate test reporter. + - ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT + + # Get and run the SonarQube scanner. + - SONAR_PROJECT_NAME="Drupal $(composer config name | cut -d / -f 2)" + - SONAR_PROJECT_KEY=web:$(echo "$TRAVIS_REPO_SLUG" | cut -d / -f 2) + - curl -L https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/4.3.0.2102/sonar-scanner-cli-4.3.0.2102.jar > sonar-scanner.jar + - "[ -d tests ] || mkdir tests" + - > + java -jar sonar-scanner.jar + -Dsonar.host.url=https://sonarqube.stad.gent + -Dsonar.login=$SONAR_LOGIN + -Dsonar.projectKey=$SONAR_PROJECT_KEY + -Dsonar.projectName="$SONAR_PROJECT_NAME" + -Dsonar.tests=tests + -Dsonar.php.coverage.reportPaths=build/logs/clover.xml diff --git a/composer.json b/composer.json index b2a5009..b38341f 100644 --- a/composer.json +++ b/composer.json @@ -9,18 +9,30 @@ "Gent", "GDPR" ], - "license": "GPL-2.0+", "homepage": "https://github.com/digipolisgent/drupal_module_dg-cookiebot", - "minimum-stability": "dev", - "prefer-stable": true, + "license": "GPL-2.0+", "authors": [ { "name": "Peter Decuyper", "email": "peter.decuyper@digipolis.gent" } ], - "support": { - "source": "https://github.com/digipolisgent/drupal_module_dg-cookiebot" + "require": { + "php": "^7.3", + "drupal/cookiebot": "^1.0@alpha", + "drupal/core": "^8.5" + }, + "require-dev": { + "digipolisgent/qa-drupal": "~1.3.7", + "sensiolabs/security-checker": "^6.0" + }, + "config": { + "sort-packages": true + }, + "extra": { + "grumphp": { + "config-default-path": "vendor/digipolisgent/qa-drupal/configs/grumphp-extension.yml" + } }, "repositories": { "drupal": { @@ -28,27 +40,17 @@ "url": "https://packages.drupal.org/8" } }, - "require": { - "php": "^7.2", - "drupal/core": "^8.5", - "drupal/cookiebot": "^1.0@alpha" - }, - "require-dev": { - "phpunit/phpunit": "^7", - "cweagans/composer-patches": "^1.6", - "squizlabs/php_codesniffer": "^3.5", - "sebastian/phpcpd": "^4.1", - "phpmd/phpmd": "^2.7", - "sensiolabs/security-checker": "^6.0", - "drupal/coder": "^8.3", - "phpro/grumphp": "^0.16.2" - }, + "minimum-stability": "dev", + "prefer-stable": true, "scripts": { + "post-install-cmd": "vendor/bin/grumphp git:init", "coverage": "vendor/bin/phpunit --configuration=phpunit-coverage.xml", "grumphp": "vendor/bin/grumphp run --ansi", "phpcs": "vendor/bin/phpcs", "phpstan": "vendor/bin/phpstan analyse --level=7 ./src", - "test": "vendor/bin/phpunit", - "post-install-cmd": "vendor/bin/grumphp git:init" + "test": "vendor/bin/phpunit" + }, + "support": { + "source": "https://github.com/digipolisgent/drupal_module_dg-cookiebot" } } diff --git a/dg_cookiebot.module b/dg_cookiebot.module index 6fe3de1..3b650d3 100644 --- a/dg_cookiebot.module +++ b/dg_cookiebot.module @@ -34,24 +34,3 @@ function dg_cookiebot_preprocess_video_embed_iframe(&$variables): void { $attributes = &$variables['attributes']; $attributes->setAttribute('data-cookieconsent', 'necessary'); } - -/** - * Implements hook_library_info_alter(). - * - * Replaces the cookiebot.js file by our own. - */ -function dg_cookiebot_library_info_alter(&$libraries, $extension) { - return; - - if ($extension !== 'cookiebot') { - return; - } - - if (!isset($libraries['cookiebot']['js']['js/cookiebot.js'])) { - return; - } - - $newPath = '/' . drupal_get_path('module', 'dg_cookiebot') . '/js/dg-cookiebot.js'; - $libraries['cookiebot']['js'][$newPath] = $libraries['cookiebot']['js']['js/cookiebot.js']; - unset($libraries['cookiebot']['js']['js/cookiebot.js']); -} diff --git a/grumphp.yml.dist b/grumphp.yml.dist deleted file mode 100644 index 308ef31..0000000 --- a/grumphp.yml.dist +++ /dev/null @@ -1,30 +0,0 @@ -parameters: - git_dir: . - bin_dir: vendor/bin - ascii: ~ - tasks: - composer: ~ - git_blacklist: - keywords: - - "die(" - - "var_dump(" - - "exit;" - phpcpd: - exclude: ['tests' ,'vendor'] - phpcs: ~ - phpmd: - whitelist_patterns: - - /^src\/(.*)/ - ruleset: - - phpmd.xml - phpunit: - config_file: "phpunit-coverage.xml" - phpversion: - project: '7.2' - securitychecker: ~ - xmllint: ~ - yamllint: ~ - git_commit_message: ~ - git_branch_name: - whitelist: - Git-flow: /(8.x-1.x|8.x-1.x-dev|feature\/(\w+-)?|(release|hotfix)\/8.x-\d+.\d+(-(alpha|beta)\d+)?)/ diff --git a/phpcs-ruleset.xml.dist b/phpcs-ruleset.xml.dist deleted file mode 100644 index 7862641..0000000 --- a/phpcs-ruleset.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Drupal coding standard for contributed modules - - - *.gif - *.less - *.png - - - *.min.css - *.min.js - - - - - - diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 22d45c1..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - Default PHP CodeSniffer configuration. - - - - - . - ./build - ./vendor - *.md - diff --git a/phpmd.xml b/phpmd.xml deleted file mode 100644 index 8ea5227..0000000 --- a/phpmd.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Ruleset for PHPMD analysis of Drupal projects. Excludes coding issues - handled better by PHPCS and rules which have too many false positives - in a typical Drupal codebase. - - - - - - - - - - - - diff --git a/phpunit-coverage.xml b/phpunit-coverage.xml deleted file mode 100644 index 1962f77..0000000 --- a/phpunit-coverage.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - tests - - - - - - - ./ - - ./ - ./ - ./vendor - ./tests/bootstrap.php - - - - - - - - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index a23574e..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - tests - - - - - - - ./ - - ./ - ./ - ./vendor - ./tests/bootstrap.php - - - - - From ecd10dd5edf98f0d52030a88ac407943aa828338 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 09:01:52 +0100 Subject: [PATCH 02/19] Add support for php 7.4 --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c9f388..668c255 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,6 @@ env: jobs: fast_finish: true - allow_failures: - - php: 7.4 before_install: # Configure the authentication mechanisms. From 9c367d2caa5ac5110a0ef3f209525dfbd9c0b938 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 09:04:26 +0100 Subject: [PATCH 03/19] Add composer memory limit to environment --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 668c255..4083e23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,12 @@ cache: - $HOME/.composer/cache env: - - DRUPAL=8.9 PHPUNIT=7.5 - - DRUPAL=9.0 PHPUNIT=8.5 - - DRUPAL=9.1 PHPUNIT=8.5 + global: + - COMPOSER_MEMORY_LIMIT=-1 + matrix: + - DRUPAL=8.9 PHPUNIT=7.5 + - DRUPAL=9.0 PHPUNIT=8.5 + - DRUPAL=9.1 PHPUNIT=8.5 jobs: fast_finish: true @@ -32,7 +35,6 @@ before_install: - ./cc-test-reporter before-build install: - - export COMPOSER_MEMORY_LIMIT=-1 - composer install -n script: From 4317e414e644c787442588c9b79346a17b8cd4ca Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 09:12:09 +0100 Subject: [PATCH 04/19] Update .codeclimate.yml --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index d928dcf..e767205 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -80,3 +80,4 @@ exclude_patterns: - "**/.idea/**/*" - "**/tests/**/*" - "**/*.settings.php" + - "RoboFile.php" From 9e4030e08bd9266c2b1fb69c7dc891a9c3c70b80 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 09:47:47 +0100 Subject: [PATCH 05/19] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4083e23..ecaf9ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,4 +56,5 @@ after_script: -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.projectName="$SONAR_PROJECT_NAME" -Dsonar.tests=tests + -Dsonar.exclusions=**/tests/**/* -Dsonar.php.coverage.reportPaths=build/logs/clover.xml From d37b72212daddcaddab30d635cacd39d043fa76e Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 09:55:15 +0100 Subject: [PATCH 06/19] Update composer --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index ecaf9ee..364935e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,13 @@ jobs: fast_finish: true before_install: + # Configure Xdebug 3.x. + - echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + + # Update composer. + - composer self-update --2 + - composer --version + # Configure the authentication mechanisms. - composer config -ga github-oauth.github.com $GITHUB_TOKEN - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN From 95b5eeddbfa27959b308f9d0a67d15daa045ca04 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 10:34:33 +0100 Subject: [PATCH 07/19] Test Travis Error: Maximum function nesting level of '256' reached, aborting! Appeared after moving COMPOSER_MEMORY_LIMIT to the Travis environment variables. --- .travis.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 364935e..761ad37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,9 @@ cache: - $HOME/.composer/cache env: - global: - - COMPOSER_MEMORY_LIMIT=-1 - matrix: - - DRUPAL=8.9 PHPUNIT=7.5 - - DRUPAL=9.0 PHPUNIT=8.5 - - DRUPAL=9.1 PHPUNIT=8.5 + - DRUPAL=8.9 PHPUNIT=7.5 + - DRUPAL=9.0 PHPUNIT=8.5 + - DRUPAL=9.1 PHPUNIT=8.5 jobs: fast_finish: true @@ -42,6 +39,7 @@ before_install: - ./cc-test-reporter before-build install: + - export COMPOSER_MEMORY_LIMIT=-1 - composer install -n script: From f0d7a5bf74a2bb35a19573a0dab1e5ba55ddb14e Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 10:50:36 +0100 Subject: [PATCH 08/19] Update .travis.yml --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 761ad37..2876767 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,16 +11,20 @@ cache: - $HOME/.composer/cache env: - - DRUPAL=8.9 PHPUNIT=7.5 - - DRUPAL=9.0 PHPUNIT=8.5 - - DRUPAL=9.1 PHPUNIT=8.5 + global: + - COMPOSER_MEMORY_LIMIT=-1 + matrix: + - DRUPAL=8.9 PHPUNIT=7.5 + - DRUPAL=9.0 PHPUNIT=8.5 + - DRUPAL=9.1 PHPUNIT=8.5 jobs: fast_finish: true before_install: - # Configure Xdebug 3.x. + # Configure php. - echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + - echo 'xdebug.max_nesting_level=1000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # Update composer. - composer self-update --2 @@ -39,7 +43,6 @@ before_install: - ./cc-test-reporter before-build install: - - export COMPOSER_MEMORY_LIMIT=-1 - composer install -n script: From 97d96a13746dd467cd43736998b5a5383a9cdf3e Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 11:14:50 +0100 Subject: [PATCH 09/19] Test composer run-script drupal-phpunit-upgrade --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2876767..7c9f36c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,6 @@ jobs: before_install: # Configure php. - echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - echo 'xdebug.max_nesting_level=1000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # Update composer. - composer self-update --2 @@ -35,7 +34,8 @@ before_install: - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN # Require Drupal core. - - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 + - composer run-script drupal-phpunit-upgrade # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter From 865551e69422885b3b5406f9109396d54bf39ac9 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 11:37:42 +0100 Subject: [PATCH 10/19] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7c9f36c..09dd12e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,6 @@ before_install: # Require Drupal core. - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 - - composer run-script drupal-phpunit-upgrade # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -44,6 +43,7 @@ before_install: install: - composer install -n + - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From 5a21a26d8546b68fddb882f6a3a108b958a5a355 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 11:44:33 +0100 Subject: [PATCH 11/19] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09dd12e..df308e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,8 @@ before_install: - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN # Require Drupal core. - - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT + - composer run-script drupal-phpunit-upgrade # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -43,7 +44,6 @@ before_install: install: - composer install -n - - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From acd384ed62af8a31f33879e8ff950cae5788322f Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 11:48:04 +0100 Subject: [PATCH 12/19] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index df308e9..051bf25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,6 @@ before_install: # Require Drupal core. - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT - - composer run-script drupal-phpunit-upgrade # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -44,6 +43,7 @@ before_install: install: - composer install -n + - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From 704f9752925c61b5c0d5e031f7a9cdc40791fa3c Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 11:56:52 +0100 Subject: [PATCH 13/19] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 051bf25..4c66dba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,8 @@ before_install: - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN # Require Drupal core. - - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 drupal/core:~$DRUPAL.0 + - composer run-script drupal-phpunit-upgrade # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -43,7 +44,6 @@ before_install: install: - composer install -n - - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From ed1f6bd569dc07c59e446ad8cc8f54c1dedaa17a Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 12:29:02 +0100 Subject: [PATCH 14/19] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c66dba..c0117d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,7 @@ before_install: - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN # Require Drupal core. - - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 drupal/core:~$DRUPAL.0 - - composer run-script drupal-phpunit-upgrade + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 drupal/core-dev:~$DRUPAL.0 # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -44,6 +43,7 @@ before_install: install: - composer install -n + - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From 34e4c941e88541a673fdaa80d16a75bc7eac7d03 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 13:08:34 +0100 Subject: [PATCH 15/19] Update .travis.yml --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c0117d3..0e9992a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ before_install: - composer config -ga http-basic.digipolis.repo.repman.io token $REPMAN_TOKEN # Require Drupal core. - - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 drupal/core-dev:~$DRUPAL.0 + - composer require -n --no-update --sort-packages --dev drupal/core:~$DRUPAL.0 phpunit/phpunit:^$PHPUNIT # Get and run the Code Climate test reporter. - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter @@ -43,7 +43,6 @@ before_install: install: - composer install -n - - composer run-script drupal-phpunit-upgrade script: - vendor/bin/grumphp run -n From 1ab496828632386baaa8ad268b900218cdd0c047 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 13:10:08 +0100 Subject: [PATCH 16/19] Create phpstan.neon --- phpstan.neon | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..57788ad --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,3 @@ +parameters: + ignoreErrors: + - '#^(?:(?!deprecated).)*$#' From d8df2d28f6adc6d885d80d6767137d8a676c076e Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Tue, 29 Dec 2020 15:15:57 +0100 Subject: [PATCH 17/19] Update .travis.yml --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e9992a..d8e2b7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,14 +17,12 @@ env: - DRUPAL=8.9 PHPUNIT=7.5 - DRUPAL=9.0 PHPUNIT=8.5 - DRUPAL=9.1 PHPUNIT=8.5 + - DRUPAL=9.2 PHPUNIT=8.5 jobs: fast_finish: true before_install: - # Configure php. - - echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - # Update composer. - composer self-update --2 - composer --version From 130197cc660a3904c427535a421007f75b65c8f2 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Wed, 30 Dec 2020 14:04:49 +0100 Subject: [PATCH 18/19] Fix deprecation Drupal\Tests\UnitTestCase::assertArrayEquals() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::assertEquals(), ::assertEqualsCanonicalizing(), or ::assertSame() instead. See https://www.drupal.org/node/3136304 --- composer.json | 5 +++-- tests/src/Unit/Plugin/Block/CookiebotSettingsLinkTest.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b38341f..7847cb4 100644 --- a/composer.json +++ b/composer.json @@ -19,11 +19,12 @@ ], "require": { "php": "^7.3", - "drupal/cookiebot": "^1.0@alpha", - "drupal/core": "^8.5" + "drupal/cookiebot": "^1.0@alpha" }, "require-dev": { "digipolisgent/qa-drupal": "~1.3.7", + "drupal/core": "~9.1.0", + "phpunit/phpunit": "^8.5", "sensiolabs/security-checker": "^6.0" }, "config": { diff --git a/tests/src/Unit/Plugin/Block/CookiebotSettingsLinkTest.php b/tests/src/Unit/Plugin/Block/CookiebotSettingsLinkTest.php index b2a2b98..6f3d5ed 100644 --- a/tests/src/Unit/Plugin/Block/CookiebotSettingsLinkTest.php +++ b/tests/src/Unit/Plugin/Block/CookiebotSettingsLinkTest.php @@ -27,7 +27,7 @@ public function buildContainsSimpleRenderArray(): void { ); $expected = ['#theme' => 'dg_cookiebot_settings_link']; - $this->assertArrayEquals( + $this->assertEquals( $expected, $block->build() ); From c5283831f7f94f9f46b2fc582d17c19eea9fb538 Mon Sep 17 00:00:00 2001 From: Maarten Segers Date: Wed, 30 Dec 2020 14:06:04 +0100 Subject: [PATCH 19/19] Update composer.json --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7847cb4..b38341f 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,11 @@ ], "require": { "php": "^7.3", - "drupal/cookiebot": "^1.0@alpha" + "drupal/cookiebot": "^1.0@alpha", + "drupal/core": "^8.5" }, "require-dev": { "digipolisgent/qa-drupal": "~1.3.7", - "drupal/core": "~9.1.0", - "phpunit/phpunit": "^8.5", "sensiolabs/security-checker": "^6.0" }, "config": {