Created
January 17, 2014 02:46
-
-
Save Quilted/8467599 to your computer and use it in GitHub Desktop.
Behat: Support taxonomy term entity references when creating new nodes during testing. Edit vender/drupal/drupalextension/src/Drupal/Driver/Core/Drupal7.php in function exandEntityFields().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Special handling for entity references. | |
elseif ('entityreference' === $info['module']) { | |
$values = explode(',', $value); | |
// Handle taxonomy terms. | |
// @todo generalize. | |
if ($info['settings']['target_type'] == 'taxonomy_term') { | |
$i = 0; | |
foreach ($values as $tid) { | |
$new_entity->{$param}[LANGUAGE_NONE][$i]['target_id'] = $tid; | |
$i++; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment