Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date/Time test for fields with a start and end date fails #11

Open
patrickfweston opened this issue Dec 11, 2015 · 1 comment
Open

Date/Time test for fields with a start and end date fails #11

patrickfweston opened this issue Dec 11, 2015 · 1 comment

Comments

@patrickfweston
Copy link
Contributor

For datefields with a start date/time and an end date/time, the test for And entity field ":field" should contain ":value" fails. The step definition checks for a value, but for these fields the value is an array instead of a scalar date string. Date fields with both a start and end date are retrieved as an array instead of as a scalar due to the unpredictability of entity_metadata_wrapper().

I've submitted a pull request with a potential fix: #10

@becw
Copy link
Member

becw commented Dec 14, 2015

I've committed that code with the to-do you added:

* @todo : Update method to handle date fields with start and end dates
* The call to $wrapper->$field->value() returns either an array or a scalar
* because entity_metadata_wrapper() makes the date field values array
* unpredictable. When working with date fields that have both a start and
* end time, an array is returned instead of a scalar. If we want to test
* for start and end dates, we would want to use Behat syntax similar to
* "Then entity field ":field should contain "<start_date> - <end_date>".
* This method would need to be updated to handle that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants