getBundleFields example

public function getAllFields($core) {
    if (!empty($this->testData['getAllFields'][$core])) {
      return $this->testData['getAllFields'][$core];
    }
    return parent::getAllFields($core);
  }

  /** * {@inheritdoc} */
  public function getBundleFields($core$entity_type_id$bundle) {
    return parent::getBundleFields($core$entity_type_id$bundle);
  }

  /** * {@inheritdoc} */
  public function getEntityFields($core$entity_type_id) {
    return parent::getEntityFields($core$entity_type_id);
  }

  /** * {@inheritdoc} */

  public function testGetBundleFields($entity_type_id$bundle, array $expected_fields) {
    $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);
  }

  /** * Provides data for testGetBundleFields. * * @return array * The data. */
  public function getBundleFieldsData() {
    return [
      
Home | Imprint | This part of the site doesn't use cookies.