function LinkUriTest::providerTestRouted

Same name and namespace 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::providerTestRouted()
  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::providerTestRouted()
  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::providerTestRouted()

Provides test cases for LinkUriTest::testTransform().

Return value

array An array of test cases, each which the following values:

  • The value array to pass to LinkUri::transform().
  • The expected path returned by LinkUri::transform().

File

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

Class

LinkUriTest
Tests <a href="/api/drupal/core%21modules%21menu_link_content%21src%21Plugin%21migrate%21process%21LinkUri.php/class/LinkUri/8.9.x" 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 providerTestRouted() {
    $tests = [];
    $value = 'http://example.com';
    $expected = 'http://example.com';
    $tests['with_scheme'] = [
        $value,
        $expected,
    ];
    $value = '<front>';
    $expected = 'internal:/';
    $tests['front'] = [
        $value,
        $expected,
    ];
    $value = '<nolink>';
    $expected = 'route:<nolink>';
    $tests['nolink'] = [
        $value,
        $expected,
    ];
    return $tests;
}

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