function UrlHelperTest::providerTestFilterQueryParameters

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestFilterQueryParameters()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestFilterQueryParameters()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestFilterQueryParameters()

Provides data to self::testFilterQueryParameters().

Return value

array

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 243

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerTestFilterQueryParameters() {
    return [
        // Test without an exclude filter.
[
            'query' => [
                'a' => [
                    'b' => 'c',
                ],
            ],
            'exclude' => [],
            'expected' => [
                'a' => [
                    'b' => 'c',
                ],
            ],
        ],
        // Exclude the 'b' element.
[
            'query' => [
                'a' => [
                    'b' => 'c',
                    'd' => 'e',
                ],
            ],
            'exclude' => [
                'a[b]',
            ],
            'expected' => [
                'a' => [
                    'd' => 'e',
                ],
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.