function TermKernelTest::testDeleteTermHierarchyDeprecation

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

File

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

Class

TermKernelTest
Kernel tests for taxonomy term functions.

Namespace

Drupal\Tests\taxonomy\Kernel

Code

public function testDeleteTermHierarchyDeprecation() : void {
    $vocabulary = $this->createVocabulary();
    $term = $this->createTerm($vocabulary);
    
    /** @var \Drupal\taxonomy\TermStorageInterface $storage */
    $storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
    $this->expectDeprecation('Drupal\\taxonomy\\TermStorage::deleteTermHierarchy() 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 cleared when deleting a taxonomy term. See https://www.drupal.org/node/2936675');
    $storage->deleteTermHierarchy([
        $term->tid,
    ]);
}

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