class FieldDiscoveryTestClass in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php \Drupal\field_discovery_test\FieldDiscoveryTestClass
- 10 core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php \Drupal\field_discovery_test\FieldDiscoveryTestClass
A test class to expose protected methods.
Hierarchy
- class \Drupal\migrate_drupal\FieldDiscovery implements FieldDiscoveryInterface- class \Drupal\field_discovery_test\FieldDiscoveryTestClass
 
Expanded class hierarchy of FieldDiscoveryTestClass
4 files declare their use of FieldDiscoveryTestClass
- FieldDiscoveryTest.php in core/modules/ migrate_drupal/ tests/ src/ Unit/ FieldDiscoveryTest.php 
- FieldDiscoveryTest.php in core/modules/ migrate_drupal/ tests/ src/ Kernel/ d6/ FieldDiscoveryTest.php 
- FieldDiscoveryTest.php in core/modules/ migrate_drupal/ tests/ src/ Kernel/ d7/ FieldDiscoveryTest.php 
- FieldDiscoveryTestTrait.php in core/modules/ migrate_drupal/ tests/ src/ Traits/ FieldDiscoveryTestTrait.php 
File
- core/modules/ migrate_drupal/ tests/ modules/ field_discovery_test/ src/ FieldDiscoveryTestClass.php, line 14 
Namespace
Drupal\field_discovery_testView source
class FieldDiscoveryTestClass extends FieldDiscovery {
  /**
   * An array of test data.
   *
   * @var array
   */
  protected $testData;
  /**
   * Constructs a FieldDiscoveryTestClass object.
   *
   * @param \Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface $field_plugin_manager
   *   The field plugin manager.
   * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
   *   The migration plugin manager.
   * @param \Psr\Log\LoggerInterface $logger
   *   The logger.
   * @param array $test_data
   *   An array of test data, keyed by method name, for overridden methods to
   *   return for the purposes of testing other methods.
   */
  public function __construct(MigrateFieldPluginManagerInterface $field_plugin_manager, MigrationPluginManagerInterface $migration_plugin_manager, LoggerInterface $logger, array $test_data = []) {
    parent::__construct($field_plugin_manager, $migration_plugin_manager, $logger);
    $this->testData = $test_data;
  }
  /**
   * {@inheritdoc}
   */
  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 getFieldInstanceStubMigrationDefinition($core) {
    return parent::getFieldInstanceStubMigrationDefinition($core);
  }
  /**
   * {@inheritdoc}
   */
  public function getCoreVersion(MigrationInterface $migration) {
    return parent::getCoreVersion($migration);
  }
  /**
   * {@inheritdoc}
   */
  public function getFieldPlugin($field_type, MigrationInterface $migration) {
    return parent::getFieldPlugin($field_type, $migration);
  }
  /**
   * {@inheritdoc}
   */
  public function getSourcePlugin($core) {
    return parent::getSourcePlugin($core);
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| FieldDiscovery:: | protected | property | An array of bundle keys, keyed by drupal core version. | |
| FieldDiscovery:: | protected | property | The CCK plugin manager. | |
| FieldDiscovery:: | protected | property | A cache of discovered fields. | |
| FieldDiscovery:: | protected | property | An array of already discovered field plugin information. | |
| FieldDiscovery:: | protected | property | The field plugin manager. | |
| FieldDiscovery:: | protected | property | The logger channel service. | |
| FieldDiscovery:: | protected | property | The migration plugin manager. | |
| FieldDiscovery:: | protected | property | An array of source plugin ids, keyed by Drupal core version. | |
| FieldDiscovery:: | protected | property | An array of supported Drupal core versions. | |
| FieldDiscovery:: | public | function | Adds the field processes to a migration. Overrides FieldDiscoveryInterface:: | |
| FieldDiscovery:: | public | function | Adds the field processes for a bundle to a migration. Overrides FieldDiscoveryInterface:: | |
| FieldDiscovery:: | public | function | Adds the field processes for an entity to a migration. Overrides FieldDiscoveryInterface:: | |
| FieldDiscovery:: | protected | function | Gets the deprecated CCK Plugin Manager service as a BC shim. | |
| FieldDiscoveryInterface:: | constant | |||
| FieldDiscoveryInterface:: | constant | |||
| FieldDiscoveryTestClass:: | protected | property | An array of test data. | |
| FieldDiscoveryTestClass:: | public | function | Gets all field information related to this migration. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Gets all field information for a particular entity type and bundle. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Finds the core version of a Drupal migration. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Gets all field information for a particular entity type. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Provides the stub migration definition for a given Drupal core version. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Returns the appropriate field plugin for a given field type. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Gets the source plugin to use to gather field information. Overrides FieldDiscovery:: | |
| FieldDiscoveryTestClass:: | public | function | Constructs a FieldDiscoveryTestClass object. Overrides FieldDiscovery:: | 
