You are here

protected function DrupalWebTestCase::assertUrl in SimpleTest 7.2

Same name and namespace in other branches
  1. 6.2 drupal_web_test_case.php \DrupalWebTestCase::assertUrl()

Pass if the internal browser's URL matches the given path.

Parameters

$path: The expected system path.

$options: (optional) Any additional options to pass for $path to url().

$message: Message to display.

$group: The group this message belongs to, defaults to 'Other'.

Return value

TRUE on pass, FALSE on fail.

File

./drupal_web_test_case.php, line 2712
Provides DrupalTestCase, DrupalUnitTestCase, and DrupalWebTestCase classes.

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

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);
}