You are here

protected static function FormattableMarkupKernelTest::getFormattableMarkupUriArgs in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::getFormattableMarkupUriArgs()
  2. 10 core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::getFormattableMarkupUriArgs()

Gets arguments for FormattableMarkup 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.

See also

\Drupal\Component\Render\FormattableMarkup

2 calls to FormattableMarkupKernelTest::getFormattableMarkupUriArgs()
FormattableMarkupKernelTest::testFormattableMarkupUri in core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php
Tests URL ":placeholders" in \Drupal\Component\Render\FormattableMarkup.
FormattableMarkupKernelTest::testFormattableMarkupUriWithExceptionUri in core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php
@dataProvider providerTestFormattableMarkupUriWithException

File

core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php, line 35

Class

FormattableMarkupKernelTest
Provides a test covering integration of FormattableMarkup with other systems.

Namespace

Drupal\KernelTests\Component\Render

Code

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