function FormattableMarkupKernelTest::getFormattableMarkupUriArgs

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::getFormattableMarkupUriArgs()
  2. 8.9.x core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php \Drupal\KernelTests\Component\Render\FormattableMarkupKernelTest::getFormattableMarkupUriArgs()
  3. 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 37

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;
}

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