function LinkFormatterTest::providerSettingsSummary

Provides test cases for ::testSettingsSummary().

File

core/modules/link/tests/src/Unit/LinkFormatterTest.php, line 158

Class

LinkFormatterTest
Tests the Field Formatter for the link field type.

Namespace

Drupal\Tests\link\Unit

Code

public static function providerSettingsSummary() : array {
  return [
    [
      [],
      [
        'Link text not trimmed',
      ],
    ],
    [
      [
        'trim_length' => 80,
      ],
      [
        'Link text trimmed to 80 characters',
      ],
    ],
    [
      [
        'trim_length' => 20,
      ],
      [
        'Link text trimmed to 20 characters',
      ],
    ],
    [
      [
        'trim_length' => 20,
        'url_only' => TRUE,
        'url_plain' => TRUE,
      ],
      [
        'Link text not trimmed',
        'Show URL only as plain-text',
      ],
    ],
    [
      [
        'trim_length' => 20,
        'url_only' => TRUE,
        'url_plain' => FALSE,
      ],
      [
        'Link text not trimmed',
        'Show URL only',
      ],
    ],
    [
      [
        'rel' => 'nofollow',
      ],
      [
        'Link text not trimmed',
        'Add rel="nofollow"',
      ],
    ],
    [
      [
        'target' => '_blank',
      ],
      [
        'Link text not trimmed',
        'Open link in new window',
      ],
    ],
  ];
}

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