1

When I run the following behat test:

Scenario: Logs in to the site
  Given users:
  | name     | pass        | mail                  | roles         | status | field_fir | field_la |
  | someuser | sompassword | [email protected] | administrator | 1      | Some      | User     |
  Given I am on "/user"
  When I fill in "Username" with "someuser"
    And I fill in "Password" with "sompassword"
    And I press "Log in"
  Then I should see "Some User"
  Then I visit "user/logout"
  Then I should be on the homepage

I get the following error:

Given users:                                # Drupal\DrupalExtension\Context\DrupalContext::createUsers()
  | name     | pass        | mail                  | roles         | status | field_fir | field_la |
  | someuser | sompassword | [email protected] | administrator | 1      | Some      | User     |
  Warning: explode() expects parameter 2 to be string, array given in /var/www/xmd8/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php line 316

The weird thing is if I remove field_fir and change Then I should see "Some User" to Then I should see "User, it works. For some strange reason it doesn't like field_fir. I verified that field_fir and field_la have exactly the same settings.

1 Answer 1

0

I didn't think this was the issue but I recently upgraded to PHP 7. I downgraded to PHP 5.6 and the issue went away. I created an issue on Drupal.org.

Turns out that I was using an older version of drupal-extension. Upgraded to and the issue went away:

"drupal/drupal-extension": "^3.2",

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.