diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-21 10:17:33 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-21 10:17:33 +0000 |
commit | 6539970db4123c1202538aa6149bf9a9e94efe66 (patch) | |
tree | 1bbe44e0f76e99c37fbd3d68715dc96db94ce1b8 /modules/simpletest/drupal_web_test_case.php | |
parent | fc8be9eeb4a8fbe872da57b8e270966a1ba45eae (diff) | |
download | brdo-6539970db4123c1202538aa6149bf9a9e94efe66.tar.gz brdo-6539970db4123c1202538aa6149bf9a9e94efe66.tar.bz2 |
#933856 by Damien Tournoud: Fixed xpath() return values are inconsistent, leading to failing tests on some environments.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-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; |