public function DrupalGetQueryArrayTestCase::testDrupalGetQueryArray

Tests that drupal_get_query_array() correctly explodes query parameters.

File

drupal/modules/simpletest/tests/common.test, line 3175
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.');
}