You are here

public function LinkUriTest::testDisablingRouteValidation in Drupal 10

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::testDisablingRouteValidation()
  2. 9 core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php \Drupal\Tests\menu_link_content\Kernel\Plugin\migrate\process\LinkUriTest::testDisablingRouteValidation()

Tests disabling route validation in LinkUri::transform().

@dataProvider providerTestDisablingRouteValidation

@covers ::transform

Parameters

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

string $expected: The expected return value of LinkUri::transform().

File

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

Class

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

Namespace

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

Code

public function testDisablingRouteValidation($value, $expected) {

  // Create a node so we have a valid route.
  Node::create([
    'nid' => 1,
    'title' => 'test',
    'type' => 'page',
  ])
    ->save();
  $actual = $this
    ->doTransform($value, [
    'validate_route' => FALSE,
  ]);
  $this
    ->assertSame($expected, $actual);
}