summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-19 02:47:38 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-19 02:47:38 +0000
commitca858345c67caca646cd7272439f0bfa03b8bdae (patch)
tree63193d4894fab16e49d4572fe625e8e34d603506 /modules/simpletest/drupal_web_test_case.php
parentdae71fe86292a9f13a100fa0b3cfe0454730f6c9 (diff)
downloadbrdo-ca858345c67caca646cd7272439f0bfa03b8bdae.tar.gz
brdo-ca858345c67caca646cd7272439f0bfa03b8bdae.tar.bz2
#255613 by boombatower: Replace old crufty manual cURL call with nice drupalGet().
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php14
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;
}
/**