From c54c98e33ebfa43c6cf87a622f2752bf4192f16d Mon Sep 17 00:00:00 2001 From: Alexander Yurchik Date: Tue, 28 Mar 2023 14:20:39 +0300 Subject: [PATCH 1/6] #91. Changed finder constraint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d33f622..20646f7 100755 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "vimeo/psalm": "^4", "nette/finder": "^2.5", - "symfony/finder": "^4.4" + "symfony/finder": "^4.4 || ^5.3 || ^6" }, "autoload": { "psr-4": { From 316608046301483add738002cd99679646398a08 Mon Sep 17 00:00:00 2001 From: Hannes Kirsman Date: Tue, 28 Mar 2023 17:26:18 +0300 Subject: [PATCH 2/6] #91 Add Lando for local development and testing. --- .lando.yml | 12 ++++++++++++ .lando/tooling-phpunit.sh | 14 ++++++++++++++ composer.json | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 .lando.yml create mode 100755 .lando/tooling-phpunit.sh diff --git a/.lando.yml b/.lando.yml new file mode 100644 index 0000000..caed5d8 --- /dev/null +++ b/.lando.yml @@ -0,0 +1,12 @@ +name: code-quality +recipe: lamp +config: + php: '8.0' + xdebug: true + +tooling: + phpunit: + service: appserver + description: Run Drupal PHPUnit tests. Run 'lando phpunit --help' for more information. + cmd: + - "/app/.lando/tooling-phpunit.sh" diff --git a/.lando/tooling-phpunit.sh b/.lando/tooling-phpunit.sh new file mode 100755 index 0000000..6085ef3 --- /dev/null +++ b/.lando/tooling-phpunit.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# +# Helper script to run drupal tests. +# + +set -euo pipefail +export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/app/vendor/bin +install -d /app/public/simpletest/browser_output +cd /app/ +XDEBUG_MODE=coverage php \ + /app/vendor/bin/phpunit \ + --configuration /app/phpunit.xml \ + "$@" diff --git a/composer.json b/composer.json index 20646f7..03289bd 100755 --- a/composer.json +++ b/composer.json @@ -55,5 +55,11 @@ }, "require-dev": { "phpunit/phpunit": "^8.3" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpro/grumphp": true + } } } From d314e0c7956a2fa60c702725b5240661738a0a85 Mon Sep 17 00:00:00 2001 From: Hannes Kirsman Date: Fri, 31 Mar 2023 15:07:04 +0300 Subject: [PATCH 3/6] #91 Update PHP in tests and Lando so tests would work. --- .circleci/config.yml | 2 +- .lando.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b03ab61..0ab2c30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: # Install all dependencies and run check tasks. build_and_test: docker: - - image: circleci/php:8.0-cli-node + - image: cimg/php:8.1 steps: # Check out source code. - checkout diff --git a/.lando.yml b/.lando.yml index caed5d8..a87d6cd 100644 --- a/.lando.yml +++ b/.lando.yml @@ -1,7 +1,7 @@ name: code-quality recipe: lamp config: - php: '8.0' + php: '8.1' xdebug: true tooling: From 16c6a74c051ae1899dfe5e987753358e70acddde Mon Sep 17 00:00:00 2001 From: Hannes Kirsman Date: Fri, 31 Mar 2023 15:46:26 +0300 Subject: [PATCH 4/6] #91 Fix broken test - isRunning() was returning array of booleans. --- tests/AbstractSinglePathProcessingTaskTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AbstractSinglePathProcessingTaskTest.php b/tests/AbstractSinglePathProcessingTaskTest.php index b123901..13b1455 100644 --- a/tests/AbstractSinglePathProcessingTaskTest.php +++ b/tests/AbstractSinglePathProcessingTaskTest.php @@ -189,7 +189,7 @@ public function testHandlesParallelProcess(): void { $this->process ->expects($this->exactly(2)) ->method('isRunning') - ->willReturnOnConsecutiveCalls([TRUE, FALSE]); + ->willReturnOnConsecutiveCalls(TRUE, FALSE); $this->process ->expects($this->once()) ->method('isSuccessful') From f5ebd8aea1116ce4d1179b7185ce577fa3407532 Mon Sep 17 00:00:00 2001 From: Hannes Kirsman Date: Fri, 31 Mar 2023 16:06:13 +0300 Subject: [PATCH 5/6] #91 Fix xdebug in Lando. --- .lando/tooling-phpunit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lando/tooling-phpunit.sh b/.lando/tooling-phpunit.sh index 6085ef3..2e0d302 100755 --- a/.lando/tooling-phpunit.sh +++ b/.lando/tooling-phpunit.sh @@ -8,7 +8,7 @@ set -euo pipefail export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/app/vendor/bin install -d /app/public/simpletest/browser_output cd /app/ -XDEBUG_MODE=coverage php \ +XDEBUG_MODE=debug php \ /app/vendor/bin/phpunit \ --configuration /app/phpunit.xml \ "$@" From 86ac4d519cdd50c3a5c00533d1b0335c773e33d0 Mon Sep 17 00:00:00 2001 From: Hannes Kirsman Date: Fri, 31 Mar 2023 16:11:04 +0300 Subject: [PATCH 6/6] #91 Update minimum requirement for PHP in readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba659d4..b3b6d20 100755 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This repository currently has the following checks: ## Pre-requisites * Composer -* PHP >= 7.1 +* PHP >= 7.3 ## Installation