You are here

public function NodeTitleFailoverTest::failoverProvider in Freelinking 8.3

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

Provide test parameters for ::testFailover.

Return value

array An array of options and expected values.

File

tests/src/Unit/Plugin/freelinking/NodeTitleFailoverTest.php, line 129

Class

NodeTitleFailoverTest
Tests the failover options for nodetitle plugin.

Namespace

Drupal\Tests\freelinking\Unit\Plugin\freelinking

Code

public function failoverProvider() {
  $noneExpected = [
    '#markup' => '[[nodetitle:Test Node|Test Node]]',
  ];
  $showTextExpected = [
    'error' => 'showtext',
  ];
  $searchExpected = [
    'error' => 'search',
  ];
  $prepopulateExpected = [
    'error' => 'prepopulate',
  ];
  $errorExpected = [
    '#theme' => 'freelink_error',
    '#plugin' => 'nodetitle',
  ];
  return [
    [
      '_none',
      $noneExpected,
    ],
    [
      'showtext',
      $showTextExpected,
    ],
    [
      'search',
      $searchExpected,
    ],
    [
      'prepopulate',
      $prepopulateExpected,
    ],
    [
      'error',
      $errorExpected,
    ],
  ];
}