function FieldDiscoveryTest::testGetEntityFields

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

Tests the protected getEntityFields method.

@covers ::getEntityFields @dataProvider getEntityFieldsData

Parameters

string $entity_type_id: The entity type ID.

array $expected_fields: The expected fields.

File

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

Class

FieldDiscoveryTest
Tests the FieldDiscovery Class.

Namespace

Drupal\Tests\migrate_drupal\Unit

Code

public function testGetEntityFields($entity_type_id, 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->getEntityFields('7', $entity_type_id);
    $this->assertSame($expected_fields, $actual_fields);
}

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