function FieldUIManageFieldsTestCase::testExternalDestinations

Tests that external URLs in the 'destinations' query parameter are blocked.

File

modules/field_ui/field_ui.test, line 458

Class

FieldUIManageFieldsTestCase
Tests the functionality of the 'Manage fields' screen.

Code

function testExternalDestinations() {
    $path = 'admin/structure/types/manage/article/fields/field_tags/field-settings';
    $options = array(
        'query' => array(
            'destinations' => array(
                'http://example.com',
            ),
        ),
    );
    $this->drupalPost($path, NULL, t('Save field settings'), $options);
    $this->assertUrl('admin/structure/types/manage/article/fields', array(), 'Stayed on the same site.');
}

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