You are here

function FieldUIManageFieldsTestCase::testExternalDestinations in Drupal 7

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

File

modules/field_ui/field_ui.test, line 452
Tests for field_ui.module.

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