You are here

public function UrlHelperTest::providerTestBuildQuery in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestBuildQuery()

Provides test data for testBuildQuery().

Return value

array

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 25
Contains \Drupal\Tests\Component\Utility\UrlHelperTest.

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestBuildQuery() {
  return array(
    array(
      array(
        'a' => ' &#//+%20@۞',
      ),
      'a=%20%26%23//%2B%2520%40%DB%9E',
      'Value was properly encoded.',
    ),
    array(
      array(
        ' &#//+%20@۞' => 'a',
      ),
      '%20%26%23%2F%2F%2B%2520%40%DB%9E=a',
      'Key was properly encoded.',
    ),
    array(
      array(
        'a' => '1',
        'b' => '2',
        'c' => '3',
      ),
      'a=1&b=2&c=3',
      'Multiple values were properly concatenated.',
    ),
    array(
      array(
        'a' => array(
          'b' => '2',
          'c' => '3',
        ),
        'd' => 'foo',
      ),
      'a[b]=2&a[c]=3&d=foo',
      'Nested array was properly encoded.',
    ),
    array(
      array(
        'foo' => NULL,
      ),
      'foo',
      'Simple parameters are properly added.',
    ),
  );
}