You are here

public function UrlValidatorTest::dataProviderUrlIsRoot in Mini site 8

Data provider for testUrlIsRoot.

File

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

Class

UrlValidatorTest
Class UrlValidatorTest.

Namespace

Drupal\Tests\minisite\Kernel

Code

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