You are here

public function DrupalGetQueryArrayTestCase::testDrupalGetQueryArray in Drupal 7

Tests that drupal_get_query_array() correctly explodes query parameters.

File

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

Class

DrupalGetQueryArrayTestCase
Tests the functionality of drupal_get_query_array().

Code

public function testDrupalGetQueryArray() {
  $url = "http://my.site.com/somepath?foo=/content/folder[@name='foo']/folder[@name='bar']";
  $parsed = parse_url($url);
  $result = drupal_get_query_array($parsed['query']);
  $this
    ->assertEqual($result['foo'], "/content/folder[@name='foo']/folder[@name='bar']", 'drupal_get_query_array() should only explode parameters on the first equals sign.');
}