You are here

public function MergeTermsConfirmTest::selectedTermsProvider in Term Merge 8

Returns possible merge options that can be selected in the interface.

Return value

array An array of options. Each option has contains the following values:

  • terms: an array of source taxonomy term ids.
  • target: a string representing the target taxonomy term.

File

tests/src/Kernel/Form/MergeTermsConfirmTest.php, line 36

Class

MergeTermsConfirmTest
Tests the Merge terms confirm form.

Namespace

Drupal\Tests\term_merge\Kernel\Form

Code

public function selectedTermsProvider() {
  $testData['no terms new target'] = [
    'terms' => [],
    'target' => 'New term',
  ];
  $testData['no terms existing target'] = [
    'terms' => [],
    'target' => '',
  ];
  $testData['one term new target'] = [
    'terms' => [
      1,
    ],
    'target' => 'New term',
  ];
  $testData['one term existing target'] = [
    'terms' => [
      1,
    ],
    'target' => '',
  ];
  $testData['two terms new target'] = [
    'terms' => [
      1,
      2,
    ],
    'target' => 'New term',
  ];
  $testData['two terms existing target'] = [
    'terms' => [
      1,
      2,
    ],
    'target' => '',
  ];
  $testData['three terms new target'] = [
    'terms' => [
      1,
      2,
      3,
    ],
    'target' => 'New term',
  ];
  $testData['three terms existing target'] = [
    'terms' => [
      1,
      2,
      3,
    ],
    'target' => '',
  ];
  $testData['four terms new target'] = [
    'terms' => [
      1,
      2,
      3,
      4,
    ],
    'target' => 'New term',
  ];
  $testData['four terms existing target'] = [
    'terms' => [
      1,
      2,
      3,
      4,
    ],
    'target' => '',
  ];
  return $testData;
}