You are here

protected function MigrateVocabularyFieldInstanceTest::assertTargetBundles in Drupal 10

Asserts the settings of an entity reference field config entity.

Parameters

string $id: The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME.

string[] $target_bundles: An array of expected target bundles.

1 call to MigrateVocabularyFieldInstanceTest::assertTargetBundles()
MigrateVocabularyFieldInstanceTest::testVocabularyFieldInstance in core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php
Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.

File

core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php, line 109

Class

MigrateVocabularyFieldInstanceTest
Vocabulary field instance migration.

Namespace

Drupal\Tests\taxonomy\Kernel\Migrate\d6

Code

protected function assertTargetBundles($id, array $target_bundles) {
  $field = FieldConfig::load($id);
  $handler_settings = $field
    ->getSetting('handler_settings');
  $this
    ->assertArrayHasKey('target_bundles', $handler_settings);
  $this
    ->assertSame($handler_settings['target_bundles'], $target_bundles);
}