You are here

public function MergeTermsTest::validatesSelectedTermsTestDataProvider in Term Merge 8

Test data provider for validatesSelectedTerms.

Return value

array An array of selections. Each selection has contains the following values:

  • selectedTerms: an array of selected source taxonomy term ids.
  • expectingErrors: a boolean indicating the form is expected to generate an error.

File

tests/src/Kernel/Form/MergeTermsTest.php, line 72

Class

MergeTermsTest
Tests the term merge form.

Namespace

Drupal\Tests\term_merge\Kernel\Form

Code

public function validatesSelectedTermsTestDataProvider() {
  $testData['No terms selected'] = [
    'selectedTerms' => [],
    'expectingErrors' => TRUE,
  ];
  $testData['One term selected'] = [
    'selectedTerms' => [
      1,
    ],
    'expectingErrors' => FALSE,
  ];
  $testData['Two terms selected'] = [
    'selectedTerms' => [
      1,
      2,
    ],
    'expectingErrors' => FALSE,
  ];
  $testData['three terms selected'] = [
    'selectedTerms' => [
      1,
      2,
      3,
    ],
    'expectingErrors' => FALSE,
  ];
  return $testData;
}