diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index ecdff06ff..1949b99a5 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -2188,7 +2188,11 @@ class DrupalWebTestCase extends DrupalTestCase { protected function xpath($xpath, array $arguments = array()) { if ($this->parse()) { $xpath = $this->buildXPathQuery($xpath, $arguments); - return $this->elements->xpath($xpath); + $result = $this->elements->xpath($xpath); + // Some combinations of PHP / libxml versions return an empty array + // instead of the documented FALSE. Forcefully convert any falsish values + // to an empty array to allow foreach(...) constructions. + return $result ? $result : array(); } else { return FALSE; |