You are here

public function SearchFailoverTest::buildLinkProvider in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/Plugin/freelinking/SearchFailoverTest.php \Drupal\Tests\freelinking\Unit\Plugin\freelinking\SearchFailoverTest::buildLinkProvider()

Provide test parameters for ::testBuildLink.

Return value

array An array of test parameters.

File

tests/src/Unit/Plugin/freelinking/SearchFailoverTest.php, line 119

Class

SearchFailoverTest
Tests the failover options for search plugin.

Namespace

Drupal\Tests\freelinking\Unit\Plugin\freelinking

Code

public function buildLinkProvider() {
  $errorExpected = [
    '#theme' => 'freelink_error',
    '#plugin' => 'search',
    '#message' => 'Search unavailable',
  ];
  $googleExpected = [
    '#type' => 'link',
    '#title' => 'Google Search Test Search',
    '#attributes' => [
      'title' => 'Search this site for content like “%dest”.',
    ],
  ];
  return [
    [
      'error',
      $errorExpected,
    ],
    [
      'google',
      $googleExpected,
    ],
  ];
}