function TermKernelTest::testUpdateTermHierarchyDeprecation

@covers \Drupal\taxonomy\TermStorage::updateTermHierarchy @group legacy

File

core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php, line 194

Class

TermKernelTest
Kernel tests for taxonomy term functions.

Namespace

Drupal\Tests\taxonomy\Kernel

Code

public function testUpdateTermHierarchyDeprecation() : void {
    $vocabulary = $this->createVocabulary();
    $term = $this->createTerm($vocabulary);
    
    /** @var \Drupal\taxonomy\TermStorageInterface $storage */
    $storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
    $this->expectDeprecation('Drupal\\taxonomy\\TermStorage::updateTermHierarchy() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. It is a no-op since 8.6.0. Parent references are automatically updated when updating a taxonomy term. See https://www.drupal.org/node/2936675');
    $storage->updateTermHierarchy($term);
}

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