You are here

public function UrlHelperTest::providerTestExternalIsLocalInvalid in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestExternalIsLocalInvalid()
  2. 9 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 631

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public 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',
    ],
  ];
}