You are here

public function LinkUriTest::doTransform in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php \Drupal\Tests\menu_link_content\Kernel\Plugin\migrate\process\LinkUriTest::doTransform()

Transforms a link path into an 'internal:' or 'entity:' URI.

Parameters

string $value: The value to pass to LinkUri::transform().

array $configuration: The plugin configuration.

Return value

string The transformed link.

3 calls to LinkUriTest::doTransform()
LinkUriTest::testDisablingRouteValidation in core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
Tests disabling route validation in LinkUri::transform().
LinkUriTest::testNotRouted in core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
Tests that Non routed URLs throws an exception.
LinkUriTest::testRouted in core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
Tests LinkUri::transform().

File

core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php, line 183

Class

LinkUriTest
Tests \Drupal\menu_link_content\Plugin\migrate\process\LinkUri.

Namespace

Drupal\Tests\menu_link_content\Kernel\Plugin\migrate\process

Code

public function doTransform($value, $configuration = []) {
  $entityTypeManager = $this->container
    ->get('entity_type.manager');
  $routeBuilder = $this->container
    ->get('router.builder');
  $row = new Row();
  $executable = $this
    ->prophesize(MigrateExecutableInterface::class)
    ->reveal();
  $plugin = new LinkUri($configuration, 'link_uri', [], $entityTypeManager, $routeBuilder);
  $actual = $plugin
    ->transform($value, $executable, $row, 'destination_property');
  return $actual;
}