From e9e0d26a08193b961605644c79f8c38dd2bccb49 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Thu, 20 Sep 2018 08:47:09 -0700 Subject: [PATCH] Re-enable testing with the Drush Behat Endpoint. Drupal style checks are failing, though; remove them for now. --- .travis.yml | 10 +++------- composer.json | 4 +++- .../Context/RawDrupalContext.php | 18 +++++++++--------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index b989be53..0210550e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,10 @@ install: # For Drupal 8 install the behat drush endpoint. # Pins symfony/dependency-injection to match core. # @see https://github.com/jhedstrom/drupalextension/issues/413 - # @todo Re-enable behat drush endpoint testing. - # @see https://github.com/jhedstrom/drupalextension/issues/458 - - test ${DRUPAL_VERSION} -ne 8 || composer require --prefer-source drush/drush:~9.0 symfony/dependency-injection:3.4.4 + - test ${DRUPAL_VERSION} -ne 8 || composer require --prefer-source drupal/drupal-driver drush/drush:^9.0.0-dev symfony/dependency-injection:3.4.4 && (git clone https://github.com/drush-ops/behat-drush-endpoint.git drush/Commands/contrib/behat-drush-endpoint) - composer install # Install drush globally. - - (test ${DRUPAL_VERSION} -ne 8 && composer global require drush/drush:~8.0 drupal/drupal-driver) || composer global require drush/drush:~9.0 + - (test ${DRUPAL_VERSION} -ne 8 && composer global require drush/drush:~8.0 drupal/drupal-driver) || composer global require drush/drush:^9.0.0-dev # Install the Behat Drush Endpoint for Drupal 7 tests. - test ${DRUPAL_VERSION} -ne 7 || (git clone https://github.com/drush-ops/behat-drush-endpoint.git drush/behat-drush-endpoint && (cd drush/behat-drush-endpoint && composer install && cd -)) # Pin node version. @@ -73,9 +71,7 @@ before_script: - cd drupal - drush --yes en behat_test - drush cc drush - # @todo Re-enable behat drush endpoint testing. - # @see https://github.com/jhedstrom/drupalextension/issues/458 - - test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat) + - test ${DRUPAL_VERSION} -eq 6 || drush help behat # Only revert features on Drupal 7. - test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test # Disable the page cache on Drupal 8. diff --git a/composer.json b/composer.json index 2705f769..1efc73b1 100644 --- a/composer.json +++ b/composer.json @@ -42,9 +42,11 @@ "composer validate --no-interaction", "parallel-lint src spec features fixtures", "phpcs --standard=./phpcs-ruleset.xml -p", - "phpcs --standard=./phpcs-drupal-ruleset.xml -p", "npm test", "phpspec run -f pretty --no-interaction" + ], + "removed-test": [ + "phpcs --standard=./phpcs-drupal-ruleset.xml -p" ] }, "autoload": { diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index 3d2593e4..b8b9ae18 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -404,17 +404,17 @@ public function parseEntityFields($entity_type, \stdClass $entity) // Reset the multicolumn field if the field name does not contain a column. if (strpos($field, ':') === false) { $multicolumn_field = ''; - } // Start tracking a new multicolumn field if the field name contains a ':' - // which is preceded by at least 1 character. - elseif (strpos($field, ':', 1) !== false) { + } elseif (strpos($field, ':', 1) !== false) { + // Start tracking a new multicolumn field if the field name contains a ':' + // which is preceded by at least 1 character. list($multicolumn_field, $multicolumn_column) = explode(':', $field); - } // If a field name starts with a ':' but we are not yet tracking a - // multicolumn field we don't know to which field this belongs. - elseif (empty($multicolumn_field)) { + } elseif (empty($multicolumn_field)) { + // If a field name starts with a ':' but we are not yet tracking a + // multicolumn field we don't know to which field this belongs. throw new \Exception('Field name missing for ' . $field); - } // Update the column name if the field name starts with a ':' and we are - // already tracking a multicolumn field. - else { + } else { + // Update the column name if the field name starts with a ':' and we are + // already tracking a multicolumn field. $multicolumn_column = substr($field, 1); }