FieldDiscoveryTestClass.php in Drupal 8
File
core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php
View source
<?php
namespace Drupal\field_discovery_test;
use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
use Drupal\migrate_drupal\FieldDiscovery;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface;
use Psr\Log\LoggerInterface;
class FieldDiscoveryTestClass extends FieldDiscovery {
protected $testData;
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;
}
public function getAllFields($core) {
if (!empty($this->testData['getAllFields'][$core])) {
return $this->testData['getAllFields'][$core];
}
return parent::getAllFields($core);
}
public function getBundleFields($core, $entity_type_id, $bundle) {
return parent::getBundleFields($core, $entity_type_id, $bundle);
}
public function getEntityFields($core, $entity_type_id) {
return parent::getEntityFields($core, $entity_type_id);
}
public function getFieldInstanceStubMigrationDefinition($core) {
return parent::getFieldInstanceStubMigrationDefinition($core);
}
public function getCoreVersion(MigrationInterface $migration) {
return parent::getCoreVersion($migration);
}
public function getFieldPlugin($field_type, MigrationInterface $migration) {
return parent::getFieldPlugin($field_type, $migration);
}
public function getSourcePlugin($core) {
return parent::getSourcePlugin($core);
}
}