You are here

function DrupalHTTPRequestTestCase::testDrupalGetDestination in SimpleTest 7

File

tests/common.test, line 842
Tests for common.inc functionality.

Class

DrupalHTTPRequestTestCase
Test drupal_http_request().

Code

function testDrupalGetDestination() {
  $query = $this
    ->randomName(10);

  // Verify that a 'destination' query string is used as destination.
  $this
    ->drupalGet('system-test/destination', array(
    'query' => array(
      'destination' => $query,
    ),
  ));
  $this
    ->assertText('The destination: ' . $query, t('The given query string destination is determined as destination.'));

  // Verify that the current path is used as destination.
  $this
    ->drupalGet('system-test/destination', array(
    'query' => array(
      $query => NULL,
    ),
  ));
  $url = 'system-test/destination?' . $query;
  $this
    ->assertText('The destination: ' . $url, t('The current path is determined as destination.'));
}