function LinkUriTest::doTransform

Same name in other branches
  1. 9 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. 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()
  3. 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()

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 185

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');
    $row = new Row();
    $executable = $this->prophesize(MigrateExecutableInterface::class)
        ->reveal();
    $plugin = new LinkUri($configuration, 'link_uri', [], $entityTypeManager);
    $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.