1 common.test CommonBackdropGotoTestCase::testBackdropGetDestination()

Test backdrop_get_destination().

File

core/modules/simpletest/tests/common.test, line 1293
Tests for common.inc functionality.

Class

CommonBackdropGotoTestCase
Tests backdrop_goto() and hook_backdrop_goto_alter().

Code

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

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

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