function UrlHelperTest::dataEnhanceWithScheme

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::dataEnhanceWithScheme()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::dataEnhanceWithScheme()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::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 UrlHelperTest::dataEnhanceWithScheme()
UrlHelperTest::providerTestInvalidAbsolute in core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
Provides data for testInvalidAbsolute().
UrlHelperTest::providerTestValidAbsoluteData in core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
Data provider for testValidAbsolute().

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 556

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.