public function TermTest::testParentHandlerSettings in Drupal 9
Same name and namespace in other branches
- 8 core/modules/taxonomy/tests/src/Functional/TermTest.php \Drupal\Tests\taxonomy\Functional\TermTest::testParentHandlerSettings()
The "parent" field must restrict references to the same vocabulary.
File
- core/
modules/ taxonomy/ tests/ src/ Functional/ TermTest.php, line 87
Class
- TermTest
- Tests load, save and delete for taxonomy terms.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
public function testParentHandlerSettings() {
$vocabulary_fields = \Drupal::service('entity_field.manager')
->getFieldDefinitions('taxonomy_term', $this->vocabulary
->id());
$parent_target_bundles = $vocabulary_fields['parent']
->getSetting('handler_settings')['target_bundles'];
$this
->assertSame([
$this->vocabulary
->id() => $this->vocabulary
->id(),
], $parent_target_bundles);
}