public function UrlValidatorTest::providerTestValidAbsoluteData

Data provider for absolute URLs.

File

drupal/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php, line 30
Contains \Drupal\Tests\Core\Common\UrlValidatorTest.

Class

UrlValidatorTest
Tests URL validation by valid_url().

Namespace

Drupal\Tests\Core\Common

Code

public function providerTestValidAbsoluteData() {
  $urls = array(
    'example.com',
    'www.example.com',
    'ex-ample.com',
    '3xampl3.com',
    'example.com/parenthesis',
    'example.com/index.html#pagetop',
    'example.com:8080',
    'subdomain.example.com',
    'example.com/index.php/node',
    'example.com/index.php/node?param=false',
    'user@www.example.com',
    'user:pass@www.example.com:8080/login.php?do=login&style=%23#pagetop',
    '127.0.0.1',
    'example.org?',
    'john%20doe:secret:foo@example.org/',
    'example.org/~,$\'*;',
    'caf%C3%A9.example.org',
    '[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html',
  );
  return $this
    ->dataEnhanceWithScheme($urls);
}