You are here

public function SearchFailoverTest::buildLinkProvider in Freelinking 4.0.x

Same name and namespace in other branches
  1. 8.3 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 121

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