You are here

protected function TermParentsTest::assertParentsUnchanged in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Functional/TermParentsTest.php \Drupal\Tests\taxonomy\Functional\TermParentsTest::assertParentsUnchanged()
  2. 9 core/modules/taxonomy/tests/src/Functional/TermParentsTest.php \Drupal\Tests\taxonomy\Functional\TermParentsTest::assertParentsUnchanged()

Asserts that the parents of the term have not changed after saving.

@internal

Parameters

\Drupal\taxonomy\TermInterface $term: The term to check.

File

core/modules/taxonomy/tests/src/Functional/TermParentsTest.php, line 306

Class

TermParentsTest
Tests managing taxonomy parents through the user interface.

Namespace

Drupal\Tests\taxonomy\Functional

Code

protected function assertParentsUnchanged(TermInterface $term) : void {
  $saved_term = $this->termStorage
    ->load($term
    ->id());
  $expected = $term
    ->get('parent')
    ->getValue();
  $this
    ->assertEquals($expected, $saved_term
    ->get('parent')
    ->getValue());
}