function UrlHelperTest::providerTestFilterBadProtocol

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

Provides data for self::testTestFilterBadProtocol().

Return value

array

File

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

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerTestFilterBadProtocol() {
    return [
        [
            'javascript://example.com?foo&bar',
            '//example.com?foo&bar',
            [
                'http',
                'https',
            ],
        ],
        // Test custom protocols.
[
            'http://example.com?foo&bar',
            '//example.com?foo&bar',
            [
                'https',
            ],
        ],
        // Valid protocol.
[
            'http://example.com?foo&bar',
            'http://example.com?foo&bar',
            [
                'https',
                'http',
            ],
        ],
        // Colon not part of the URL scheme.
[
            '/test:8888?foo&bar',
            '/test:8888?foo&bar',
            [
                'http',
            ],
        ],
    ];
}

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