From 271a36b0fbe17615ab0702b8c49de8dd678a9697 Mon Sep 17 00:00:00 2001 From: Mike Madison <> Date: Tue, 3 May 2022 08:21:45 -0700 Subject: [PATCH 1/3] Fixes #247 to add PHP 8.x and 8.1.x into travis ci runs. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 26a0345..69e2c7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: php php: - - 7.3 - 7.4 + - 8.0 + - 8.1 install: - composer install From 47fb4d8450c820b49be3c080aebc17ad93984ef2 Mon Sep 17 00:00:00 2001 From: Mike Madison <> Date: Tue, 3 May 2022 08:21:58 -0700 Subject: [PATCH 2/3] Updating composer packages to support PHP 8.1.x and Drupal 10.x. --- composer.json | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 7aebd14..9412b08 100644 --- a/composer.json +++ b/composer.json @@ -12,18 +12,19 @@ } ], "require": { - "php": ">=5.6", - "symfony/process": "~2.5|~3.0|~4.4", - "symfony/dependency-injection": "~2.6|~3.0|~4.4", - "drupal/core-utility": "^8.4 || ^9" + "php": ">=7.4", + "symfony/process": "~2.5|~3.0|~4.4|^6", + "symfony/dependency-injection": "~2.6|~3.0|~4.4|^6", + "drupal/core-utility": "^8.4 || ^9 || ^10.0.0-alpha1" }, "require-dev": { "drupal/coder": "~8.3.0", - "phpspec/phpspec": "~2.0 || ~4.0 || ~6.1", - "phpunit/phpunit": "~6.0 || ~7.0", - "mockery/mockery": "0.9.4", + "phpspec/phpspec": "~2.0 || ~4.0 || ~6.1 || dev-main", + "phpunit/phpunit": "~6.0 || ~7.0 || ^9", + "mockery/mockery": "^0.9.4", "drush-ops/behat-drush-endpoint": "*", - "jakub-onderka/php-parallel-lint": "^1.0" + "php-parallel-lint/php-parallel-lint": "^1.0", + "dms/phpunit-arraysubset-asserts": "^0.4.0" }, "scripts": { "test": [ @@ -45,5 +46,10 @@ "branch-alias": { "dev-master": "2.2.x-dev" } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } From e4ea4d76b40376132a9433afbaea071680f91525 Mon Sep 17 00:00:00 2001 From: Mike Madison <> Date: Tue, 3 May 2022 08:22:11 -0700 Subject: [PATCH 3/3] Refactoring PHPUnit tests to support phpunit 9.x. --- .gitignore | 2 ++ tests/Drupal/Tests/Driver/Drupal7FieldHandlerTest.php | 4 +++- tests/Drupal/Tests/Driver/FieldHandlerAbstractTest.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b9e60d3..50dd546 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ composer.lock reports vendor drush + +.phpunit.result.cache diff --git a/tests/Drupal/Tests/Driver/Drupal7FieldHandlerTest.php b/tests/Drupal/Tests/Driver/Drupal7FieldHandlerTest.php index da91982..7878567 100644 --- a/tests/Drupal/Tests/Driver/Drupal7FieldHandlerTest.php +++ b/tests/Drupal/Tests/Driver/Drupal7FieldHandlerTest.php @@ -2,6 +2,8 @@ namespace Drupal\Tests\Driver; +use DMS\PHPUnitExtensions\ArraySubset\Assert; + /** * Tests the Drupal 7 field handlers. */ @@ -32,7 +34,7 @@ public function testFieldHandlers($class_name, $entity, $entity_type, array $fie $field_name = $field['field_name']; $expanded_values = $handler->expand($this->values($entity->$field_name)); - $this->assertArraySubset($expected_values, $expanded_values); + Assert::assertArraySubset($expected_values, $expanded_values); } /** diff --git a/tests/Drupal/Tests/Driver/FieldHandlerAbstractTest.php b/tests/Drupal/Tests/Driver/FieldHandlerAbstractTest.php index 11fd57b..165e6f7 100644 --- a/tests/Drupal/Tests/Driver/FieldHandlerAbstractTest.php +++ b/tests/Drupal/Tests/Driver/FieldHandlerAbstractTest.php @@ -12,7 +12,7 @@ abstract class FieldHandlerAbstractTest extends TestCase { /** * {@inheritdoc} */ - public function tearDown() { + public function tearDown(): void { \Mockery::close(); }