function FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath

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

Data provider for ::testRenderTrimmedWithMoreLinkAndPath().

Return value

array Test data.

File

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

Class

FieldPluginBaseTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21field%21FieldPluginBase.php/class/FieldPluginBase/11.x" title="Base class for views fields." class="local">\Drupal\views\Plugin\views\field\FieldPluginBase</a> @group views

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

public static function providerTestRenderTrimmedWithMoreLinkAndPath() {
    $data = [];
    // Simple path with default options.
    $data[] = [
        'test-path',
        '/test-path',
    ];
    // Add a fragment.
    $data[] = [
        'test-path#test',
        '/test-path#test',
    ];
    // Query specified as part of the path.
    $data[] = [
        'test-path?foo=bar',
        '/test-path?foo=bar',
    ];
    // Empty path.
    $data[] = [
        '',
        '/%3Cfront%3E',
    ];
    // Front page path.
    $data[] = [
        '<front>',
        '/%3Cfront%3E',
    ];
    // External URL.
    $data[] = [
        'https://www.example.com',
        'https://www.example.com',
    ];
    $data[] = [
        'http://www.example.com',
        'http://www.example.com',
    ];
    $data[] = [
        'www.example.com',
        '/www.example.com',
    ];
    return $data;
}

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