class FieldDiscoveryTestClass
Same name in other branches
- 9 core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php \Drupal\field_discovery_test\FieldDiscoveryTestClass
- 8.9.x core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php \Drupal\field_discovery_test\FieldDiscoveryTestClass
- 11.x 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\field_discovery_test\FieldDiscoveryTestClass extends \Drupal\migrate_drupal\FieldDiscovery
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
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.