protected function UrlValidatorTest::dataEnhanceWithScheme

Enhances test urls with schemes

Parameters

array $urls: The list of urls.

Return value

array A list of provider data with schemes.

2 calls to UrlValidatorTest::dataEnhanceWithScheme()
UrlValidatorTest::providerTestInvalidAbsolute in drupal/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
Provides invalid absolute URLs.
UrlValidatorTest::providerTestValidAbsoluteData in drupal/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
Data provider for absolute URLs.

File

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

Class

UrlValidatorTest
Tests URL validation by valid_url().

Namespace

Drupal\Tests\Core\Common

Code

protected function dataEnhanceWithScheme(array $urls) {
  $url_schemes = array(
    'http',
    'https',
    'ftp',
  );
  $data = array();
  foreach ($url_schemes as $scheme) {
    foreach ($urls as $url) {
      $data[] = array(
        $url,
        $scheme,
      );
    }
  }
  return $data;
}