function UrlHelperTest::providerTestExternalIsLocalInvalid

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

Provides invalid argument data for local external URL detection.

See also

\Drupal\Tests\Component\Utility\UrlHelperTest::testExternalIsLocalInvalid()

File

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

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerTestExternalIsLocalInvalid() {
    return [
        [
            'http://example.com/foo',
            '',
        ],
        [
            'http://example.com/foo',
            'bar',
        ],
        [
            'http://example.com/foo',
            'http://',
        ],
        // Invalid destination URLs.
[
            '',
            'http://example.com/foo',
        ],
        [
            'bar',
            'http://example.com/foo',
        ],
        [
            '/bar',
            'http://example.com/foo',
        ],
        [
            'bar/',
            'http://example.com/foo',
        ],
        [
            'http://',
            'http://example.com/foo',
        ],
    ];
}

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