You are here

public function TermMergerTermCrudTest::canOnlyMergeTermsInTheSameVocabulary in Term Merge 8

Tests only taxonomy terms in the same vocabulary can be merged.

@test @dataProvider mergeTermFunctionsProvider

Parameters

string $methodName: The merge method being tested.

string $target: The label for the taxonomy term target.

File

tests/src/Kernel/TermMergerTermCrudTest.php, line 49

Class

TermMergerTermCrudTest
Tests term merging for taxonomy terms.

Namespace

Drupal\Tests\term_merge\Kernel

Code

public function canOnlyMergeTermsInTheSameVocabulary($methodName, $target) {
  $this
    ->expectException('\\RuntimeException', 'Only merges within the same vocabulary are supported');
  $vocab2 = $this
    ->createVocabulary();
  $term3 = $this
    ->createTerm($vocab2);
  $terms = [
    reset($this->terms),
    $term3,
  ];
  $sut = $this
    ->createSubjectUnderTest();
  $sut
    ->{$methodName}($terms, $this
    ->prepareTarget($target));
}