function FieldDiscoveryTest::testGetBundleFields

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::testGetBundleFields()
  2. 8.9.x core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::testGetBundleFields()
  3. 10 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::testGetBundleFields()

Tests the protected getEntityFields method.

@covers ::getBundleFields @dataProvider getBundleFieldsData

Parameters

string $entity_type_id: The entity type ID.

string $bundle: The bundle.

array $expected_fields: The expected fields.

File

core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php, line 142

Class

FieldDiscoveryTest
Tests the FieldDiscovery Class.

Namespace

Drupal\Tests\migrate_drupal\Unit

Code

public function testGetBundleFields($entity_type_id, $bundle, array $expected_fields) : void {
    $test_data = [
        'getAllFields' => [
            '7' => $this->getAllFieldData(),
        ],
    ];
    $field_discovery = new FieldDiscoveryTestClass($this->fieldPluginManager
        ->reveal(), $this->migrationPluginManager
        ->reveal(), $this->logger
        ->reveal(), $test_data);
    $actual_fields = $field_discovery->getBundleFields('7', $entity_type_id, $bundle);
    $this->assertSame($expected_fields, $actual_fields);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.