function MigrateTaxonomyTermTest::getParentIDs

Same name and namespace in other branches
  1. 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyTermTest::getParentIDs()
  2. 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyTermTest::getParentIDs()
  3. 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyTermTest::getParentIDs()

Retrieves the parent term IDs for a given term.

Parameters

$tid: ID of the term to check.

Return value

array List of parent term IDs.

1 call to MigrateTaxonomyTermTest::getParentIDs()
MigrateTaxonomyTermTest::assertEntity in core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
Validate a migrated term contains the expected values.

File

core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php, line 219

Class

MigrateTaxonomyTermTest
Upgrade taxonomy terms.

Namespace

Drupal\Tests\taxonomy\Kernel\Migrate\d7

Code

protected function getParentIDs($tid) {
    return array_keys(\Drupal::entityTypeManager()->getStorage('taxonomy_term')
        ->loadParents($tid));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.