summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index b6c901695..d75f761d6 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -2518,6 +2518,31 @@ class DrupalWebTestCase extends DrupalTestCase {
}
/**
+ * Pass if the internal browser's URL matches the given path.
+ *
+ * @param $path
+ * The expected system path.
+ * @param $options
+ * (optional) Any additional options to pass for $path to url().
+ * @param $message
+ * Message to display.
+ * @param $group
+ * The group this message belongs to, defaults to 'Other'.
+ *
+ * @return
+ * TRUE on pass, FALSE on fail.
+ */
+ protected function assertUrl($path, array $options = array(), $message = '', $group = 'Other') {
+ if (!$message) {
+ $message = t('Current URL is @url.', array(
+ '@url' => var_export(url($path, $options), TRUE),
+ ));
+ }
+ $options['absolute'] = TRUE;
+ return $this->assertEqual($this->getUrl(), url($path, $options), $message, $group);
+ }
+
+ /**
* Pass if the raw text IS found on the loaded page, fail otherwise. Raw text
* refers to the raw HTML that the page generated.
*