function 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.

9 calls to DrupalWebTestCase::assertUrl()
CommonURLWebTest::testInternalPathMimicsExternal in modules/simpletest/tests/common.test
Tests the url() function on internal paths which mimic external URLs.
FieldUIManageFieldsTestCase::testDuplicateFieldName in modules/field_ui/field_ui.test
Tests that a duplicate field name is caught by validation.
FieldUIManageFieldsTestCase::testExternalDestinations in modules/field_ui/field_ui.test
Tests that external URLs in the 'destinations' query parameter are blocked.
FilePrivateTestCase::testPrivateFile in modules/file/tests/file.test
Tests file access for file uploaded to a private node.
FilterFormatAccessTestCase::testFormatWidgetPermissions in modules/filter/filter.test
Tests editing a page using a disallowed text format.

... See full list

File

modules/simpletest/drupal_web_test_case.php, line 3275

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.