You are here

function ConfirmFormTest::testConfirmForm in Drupal 7

Tests that the confirm form does not use external destinations.

File

modules/system/system.test, line 3081
Tests for system.module.

Class

ConfirmFormTest
Tests confirm form destinations.

Code

function testConfirmForm() {
  $this
    ->drupalGet('user/1/cancel');
  $this
    ->assertCancelLinkUrl(url('user/1'));
  $this
    ->drupalGet('user/1/cancel', array(
    'query' => array(
      'destination' => 'node',
    ),
  ));
  $this
    ->assertCancelLinkUrl(url('node'));
  $this
    ->drupalGet('user/1/cancel', array(
    'query' => array(
      'destination' => 'http://example.com',
    ),
  ));
  $this
    ->assertCancelLinkUrl(url('user/1'));
}