diff --git a/.travis.yml b/.travis.yml index 035f1380..3d7a8a37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ language: php php: - 7.3 - 7.4 + - 8.0 + - 8.1 env: global: @@ -10,7 +12,6 @@ env: - TRAVIS_NODE_VERSION="4.0.0" matrix: - DRUPAL_VERSION=7 - - DRUPAL_VERSION=8 - DRUPAL_VERSION=9 # Enable Travis containers. diff --git a/composer.json b/composer.json index d43caef4..c2b1c3c4 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require": { "behat/behat": "~3.2", "behat/mink": "~1.5", - "behat/mink-extension": "~2.0", + "friends-of-behat/mink-extension": "^2", "behat/mink-goutte-driver": "~1.0", "behat/mink-selenium2-driver": "~1.1", "drupal/drupal-driver": "^2.1.0", @@ -38,7 +38,7 @@ "drupal/core-recommended": "^9.1", "drush/drush": "^10.5", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpspec/phpspec": "^4.0 || ^6.0" + "phpspec/phpspec": "^4.0 || ^6.0 || ^7.0" }, "scripts": { "test": [ diff --git a/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_adress.yml b/fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_address.yml similarity index 100% rename from fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_adress.yml rename to fixtures/drupal8/modules/behat_test/config/install/field.storage.node.field_post_address.yml diff --git a/fixtures/drupal8/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php b/fixtures/drupal8/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php index 5e35ba7c..371e2527 100644 --- a/fixtures/drupal8/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php +++ b/fixtures/drupal8/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php @@ -38,7 +38,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen $element[$key] = [ '#type' => 'textfield', '#title' => $title, - '#default_value' => isset($items[$delta]->$key) ? $items[$delta]->$key : '', + '#default_value' => $items[$delta]->$key ?? '', ]; } diff --git a/fixtures/drupal9/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php b/fixtures/drupal9/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php index 5e35ba7c..371e2527 100644 --- a/fixtures/drupal9/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php +++ b/fixtures/drupal9/modules/behat_test/src/Plugin/Field/FieldWidget/AddressFieldWidget.php @@ -38,7 +38,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen $element[$key] = [ '#type' => 'textfield', '#title' => $title, - '#default_value' => isset($items[$delta]->$key) ? $items[$delta]->$key : '', + '#default_value' => $items[$delta]->$key ?? '', ]; } diff --git a/src/Drupal/DrupalDriverManager.php b/src/Drupal/DrupalDriverManager.php index 14ce64c6..1bcf1130 100644 --- a/src/Drupal/DrupalDriverManager.php +++ b/src/Drupal/DrupalDriverManager.php @@ -64,7 +64,7 @@ public function registerDriver($name, DriverInterface $driver) */ public function getDriver($name = null) { - $name = strtolower($name) ?: $this->defaultDriverName; + $name = null === $name ? $this->defaultDriverName : strtolower($name); if (null === $name) { throw new \InvalidArgumentException('Specify a Drupal driver to get.'); diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index bf9754fe..81e5d2e0 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -423,7 +423,7 @@ public function parseEntityFields($entity_type, \stdClass $entity) // Split up multiple values in multi-value fields. $values = []; foreach (str_getcsv($field_value) as $key => $value) { - $value = trim($value); + $value = trim((string) $value); $columns = $value; // Split up field columns if the ' - ' separator is present. if (strstr($value, ' - ') !== false) {