function FieldPluginBaseTest::providerTestRenderAsLinkWithPathAndTokens

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsLinkWithPathAndTokens()
  2. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsLinkWithPathAndTokens()
  3. 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsLinkWithPathAndTokens()

Data provider for ::testRenderAsLinkWithPathAndTokens().

Return value

array Test data.

File

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php, line 564

Class

FieldPluginBaseTest
@coversDefaultClass \Drupal\views\Plugin\views\field\FieldPluginBase @group views

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

public static function providerTestRenderAsLinkWithPathAndTokens() {
    $tokens = [
        '{{ foo }}' => 123,
    ];
    $link_html = '<a href="/test-path/123">value</a>';
    $data = [];
    $data[] = [
        'test-path/{{foo}}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{ foo}}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{  foo}}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{foo }}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{foo  }}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{ foo }}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{  foo }}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{ foo  }}',
        $tokens,
        $link_html,
    ];
    $data[] = [
        'test-path/{{  foo  }}',
        $tokens,
        $link_html,
    ];
    return $data;
}

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