public function TermMergerTermCrudTest::mergeIntoNewTermCreatesNewTerm in Term Merge 8
Tests a newly created term is available when merging to a new term.
@test
File
- tests/
src/ Kernel/ TermMergerTermCrudTest.php, line 84
Class
- TermMergerTermCrudTest
- Tests term merging for taxonomy terms.
Namespace
Drupal\Tests\term_merge\KernelCode
public function mergeIntoNewTermCreatesNewTerm() {
$sut = $this
->createSubjectUnderTest();
$termLabel = 'newTerm';
$term = $sut
->mergeIntoNewTerm($this->terms, $termLabel);
self::assertTrue($term instanceof TermInterface);
self::assertSame($termLabel, $term
->label());
// Id is only set if the term has been saved.
self::assertNotNull($term
->id());
}