Skip to content

Commit 4950de1

Browse files
committed
Issue #3305609 by pooja_sharma, joachim: convert TermTest::testParentHandlerSettings() into a kernel test
1 parent 4b9da47 commit 4950de1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

modules/taxonomy/tests/src/Functional/TermTest.php

-9
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ protected function setUp(): void {
8989
->save();
9090
}
9191

92-
/**
93-
* The "parent" field must restrict references to the same vocabulary.
94-
*/
95-
public function testParentHandlerSettings(): void {
96-
$vocabulary_fields = \Drupal::service('entity_field.manager')->getFieldDefinitions('taxonomy_term', $this->vocabulary->id());
97-
$parent_target_bundles = $vocabulary_fields['parent']->getSetting('handler_settings')['target_bundles'];
98-
$this->assertSame([$this->vocabulary->id() => $this->vocabulary->id()], $parent_target_bundles);
99-
}
100-
10192
/**
10293
* Tests terms in a single and multiple hierarchy.
10394
*/

modules/taxonomy/tests/src/Kernel/TermKernelTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,14 @@ public function testRevisionLogAccess(): void {
196196
$this->assertFalse($entity->get('revision_log_message')->access('view', $viewer));
197197
}
198198

199+
/**
200+
* The "parent" field must restrict references to the same vocabulary.
201+
*/
202+
public function testParentHandlerSettings(): void {
203+
$vocabulary = $this->createVocabulary();
204+
$vocabulary_fields = \Drupal::service('entity_field.manager')->getFieldDefinitions('taxonomy_term', $vocabulary->id());
205+
$parent_target_bundles = $vocabulary_fields['parent']->getSetting('handler_settings')['target_bundles'];
206+
$this->assertSame([$vocabulary->id() => $vocabulary->id()], $parent_target_bundles);
207+
}
208+
199209
}

0 commit comments

Comments
 (0)