function FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath()
  2. 10 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 277

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

public 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.drupal.org',
        'https://www.drupal.org',
    ];
    $data[] = [
        'http://www.drupal.org',
        'http://www.drupal.org',
    ];
    $data[] = [
        'www.drupal.org',
        '/www.drupal.org',
    ];
    return $data;
}

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