function LinkUriTest::doTransform

Same name and namespace in other branches
  1. 8.9.x core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php \Drupal\Tests\menu_link_content\Kernel\Plugin\migrate\process\LinkUriTest::doTransform()
  2. 10 core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php \Drupal\Tests\menu_link_content\Kernel\Plugin\migrate\process\LinkUriTest::doTransform()
  3. 11.x 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 <a href="/api/drupal/core%21modules%21menu_link_content%21src%21Plugin%21migrate%21process%21LinkUri.php/class/LinkUri/9" title="Generates an internal URI from the source value." class="local">\Drupal\menu_link_content\Plugin\migrate\process\LinkUri</a>.

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

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