function FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath

Same name 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. 11.x 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 \Drupal\views\Plugin\views\field\FieldPluginBase @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.