You are here

public function RouteTest::providerTestRouteWithParamQuery in Drupal 9

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

Data provider for testRouteWithParamQuery().

Return value

array An array of arrays, where the first element is the input to the Route process plugin, and the second is the expected results.

File

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

Class

RouteTest
Tests the route process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public function providerTestRouteWithParamQuery() {
  $values = [];
  $expected = [];

  // Valid link path with query options and parameters.
  $values[0] = [
    'user/1/edit',
    [
      'attributes' => [
        'title' => 'Edit admin',
      ],
      'query' => [
        'destination' => '/admin/people',
      ],
    ],
  ];
  $expected[0] = [
    'route_name' => 'entity.user.edit_form',
    'route_parameters' => [
      'user' => '1',
    ],
    'options' => [
      'attributes' => [
        'title' => 'Edit admin',
      ],
      'query' => [
        'destination' => '/admin/people',
      ],
    ],
    'url' => NULL,
  ];
  return [
    // Test with valid link path with parameters and options.
    [
      $values[0],
      $expected[0],
    ],
  ];
}