protected function UrlValidatorTest::dataEnhanceWithPrefix

Enhances test urls with prefixes.

Parameters

array $urls: The list of urls.

Return value

array A list of provider data with prefixes.

2 calls to UrlValidatorTest::dataEnhanceWithPrefix()
UrlValidatorTest::providerTestInvalidRelativeData in drupal/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
Provides invalid relative URLs.
UrlValidatorTest::providerTestValidRelativeData in drupal/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
Provides valid relative URLs

File

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

Class

UrlValidatorTest
Tests URL validation by valid_url().

Namespace

Drupal\Tests\Core\Common

Code

protected function dataEnhanceWithPrefix(array $urls) {
  $prefixes = array(
    '',
    '/',
  );
  $data = array();
  foreach ($prefixes as $prefix) {
    foreach ($urls as $url) {
      $data[] = array(
        $url,
        $prefix,
      );
    }
  }
  return $data;
}