function RouteTest::doTransform

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/process/RouteTest.php \Drupal\Tests\migrate\Kernel\process\RouteTest::doTransform()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/process/RouteTest.php \Drupal\Tests\migrate\Kernel\process\RouteTest::doTransform()
  3. 10 core/modules/migrate/tests/src/Kernel/process/RouteTest.php \Drupal\Tests\migrate\Kernel\process\RouteTest::doTransform()

Transforms link path data to a route.

Parameters

array|string $value: Source link path information.

Return value

array The route information based on the source link_path.

2 calls to RouteTest::doTransform()
RouteTest::testRoute in core/modules/migrate/tests/src/Kernel/process/RouteTest.php
Tests Route plugin based on providerTestRoute() values.
RouteTest::testRouteWithParamQuery in core/modules/migrate/tests/src/Kernel/process/RouteTest.php
Tests Route plugin based on providerTestRoute() values.

File

core/modules/migrate/tests/src/Kernel/process/RouteTest.php, line 265

Class

RouteTest
Tests the route process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

protected function doTransform($value) {
    $pathValidator = $this->container
        ->get('path.validator');
    $row = new Row();
    $migration = $this->prophesize(MigrationInterface::class)
        ->reveal();
    $executable = $this->prophesize(MigrateExecutableInterface::class)
        ->reveal();
    $plugin = new Route([], 'route', [], $migration, $pathValidator);
    $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.