You are here

public function FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderTrimmedWithMoreLinkAndPath()
  2. 9 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
Contains \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest.

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;
}