You are here

public function UrlValidatorTest::dataProviderUrlIsExternal in Mini site 8

Data provider for testUrlIsExternal.

File

tests/src/Kernel/UrlValidatorTest.php, line 33

Class

UrlValidatorTest
Class UrlValidatorTest.

Namespace

Drupal\Tests\minisite\Kernel

Code

public function dataProviderUrlIsExternal() {
  return [
    [
      'http://example.com',
      TRUE,
    ],
    [
      'http://www.example.com',
      TRUE,
    ],
    [
      '//example.com',
      TRUE,
    ],
    [
      'example.com',
      FALSE,
    ],
    [
      'page',
      FALSE,
    ],
    [
      '/page',
      FALSE,
    ],
    [
      'sub/page',
      FALSE,
    ],
    [
      '/sub/page',
      FALSE,
    ],
    [
      '../sub/page',
      FALSE,
    ],
    [
      './sub/page',
      FALSE,
    ],
  ];
}