Issue #3305609 by pooja_sharma, joachim: convert TermTest::testParentHandlerSettings() into a kernel test

merge-requests/8877/head
Dave Long 2024-07-22 12:26:12 +01:00
parent eba56b0fd7
commit dca3ac8cbe
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
2 changed files with 10 additions and 9 deletions

View File

@ -89,15 +89,6 @@ class TermTest extends TaxonomyTestBase {
->save(); ->save();
} }
/**
* The "parent" field must restrict references to the same vocabulary.
*/
public function testParentHandlerSettings(): void {
$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);
}
/** /**
* Tests terms in a single and multiple hierarchy. * Tests terms in a single and multiple hierarchy.
*/ */

View File

@ -196,4 +196,14 @@ class TermKernelTest extends KernelTestBase {
$this->assertFalse($entity->get('revision_log_message')->access('view', $viewer)); $this->assertFalse($entity->get('revision_log_message')->access('view', $viewer));
} }
/**
* The "parent" field must restrict references to the same vocabulary.
*/
public function testParentHandlerSettings(): void {
$vocabulary = $this->createVocabulary();
$vocabulary_fields = \Drupal::service('entity_field.manager')->getFieldDefinitions('taxonomy_term', $vocabulary->id());
$parent_target_bundles = $vocabulary_fields['parent']->getSetting('handler_settings')['target_bundles'];
$this->assertSame([$vocabulary->id() => $vocabulary->id()], $parent_target_bundles);
}
} }