summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-08 12:22:59 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-08 12:22:59 +0000
commit47db34f2d1fafc20a6ca85b40005714b8fb0fc81 (patch)
treeb62d15a1f677ad7a0a9d73adb1c6f250ebd5939d /modules/simpletest/drupal_web_test_case.php
parent5ef8911af931c588864a7cdcc0bdfed1de5fe493 (diff)
downloadbrdo-47db34f2d1fafc20a6ca85b40005714b8fb0fc81.tar.gz
brdo-47db34f2d1fafc20a6ca85b40005714b8fb0fc81.tar.bz2
- Patch #842966 by boombatower: link handling functionality should use XPath normalize-space().
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 5433a5ff2..dfe5d1dc8 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -2117,7 +2117,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertLink($label, $index = 0, $message = '', $group = 'Other') {
- $links = $this->xpath('//a[text()=:label]', array(':label' => $label));
+ $links = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
$message = ($message ? $message : t('Link with label %label found.', array('%label' => $label)));
return $this->assert(isset($links[$index]), $message, $group);
}
@@ -2137,7 +2137,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertNoLink($label, $message = '', $group = 'Other') {
- $links = $this->xpath('//a[text()=:label]', array(':label' => $label));
+ $links = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
$message = ($message ? $message : t('Link with label %label not found.', array('%label' => $label)));
return $this->assert(empty($links), $message, $group);
}
@@ -2199,7 +2199,7 @@ class DrupalWebTestCase extends DrupalTestCase {
*/
protected function clickLink($label, $index = 0) {
$url_before = $this->getUrl();
- $urls = $this->xpath('//a[text()=:label]', array(':label' => $label));
+ $urls = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
if (isset($urls[$index])) {
$url_target = $this->getAbsoluteUrl($urls[$index]['href']);