You are here

protected static function SafeMarkupKernelTest::getSafeMarkupUriArgs in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php \Drupal\KernelTests\Component\Utility\SafeMarkupKernelTest::getSafeMarkupUriArgs()

Gets arguments for SafeMarkup::format() based on Url::fromUri() parameters.

Parameters

string $uri: The URI of the resource.

array $options: The options to pass to Url::fromUri().

Return value

array Array containing:

  • ':url': A URL string.
2 calls to SafeMarkupKernelTest::getSafeMarkupUriArgs()
SafeMarkupKernelTest::testSafeMarkupUri in core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php
Tests URL ":placeholders" in SafeMarkup::format().
SafeMarkupKernelTest::testSafeMarkupUriWithExceptionUri in core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php
@dataProvider providerTestSafeMarkupUriWithException @expectedException \InvalidArgumentException

File

core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php, line 49
Contains \Drupal\KernelTests\Component\Utility\SafeMarkupKernelTest.

Class

SafeMarkupKernelTest
Provides a test covering integration of SafeMarkup with other systems.

Namespace

Drupal\KernelTests\Component\Utility

Code

protected static function getSafeMarkupUriArgs($uri, $options = []) {
  $args[':url'] = Url::fromUri($uri, $options)
    ->toString();
  return $args;
}