diff options
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index beaee6a91..5bfba7c62 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1195,7 +1195,6 @@ class DrupalWebTestCase { * later one if an index is given. Match is case insensitive with * normalized space. The label is translated label. There is an assert * for successful click. - * WARNING: Assertion fails on empty ("") output from the clicked link. * * @param $label * Text between the anchor tags. @@ -1206,15 +1205,18 @@ class DrupalWebTestCase { */ function clickLink($label, $index = 0) { $url_before = $this->getUrl(); - $ret = FALSE; $urls = $this->xpath('//a[text()="' . $label . '"]'); + if (isset($urls[$index])) { $url_target = $this->getAbsoluteUrl($urls[$index]['href']); - $curl_options = array(CURLOPT_URL => $url_target); - $ret = $this->curlExec($curl_options); } - $this->assertTrue($ret, t('Clicked link !label (!url_target) from !url_before', array('!label' => $label, '!url_target' => $url_target, '!url_before' => $url_before)), t('Browser')); - return $ret; + + $this->assertTrue(isset($urls[$index]), t('Clicked link "!label" (!url_target) from !url_before', array('!label' => $label, '!url_target' => $url_target, '!url_before' => $url_before)), t('Browser')); + + if (isset($urls[$index])) { + return $this->drupalGet($url_target); + } + return FALSE; } /** |