getCoreVersion example


  public function __construct(MigrateFieldPluginManagerInterface $field_plugin_manager, MigrationPluginManagerInterface $migration_plugin_manager, LoggerInterface $logger) {
    $this->fieldPluginManager = $field_plugin_manager;
    $this->migrationPluginManager = $migration_plugin_manager;
    $this->logger = $logger;
  }

  /** * {@inheritdoc} */
  public function addAllFieldProcesses(MigrationInterface $migration) {
    $core = $this->getCoreVersion($migration);
    $fields = $this->getAllFields($core);
    foreach ($fields as $entity_type_id => $bundle) {
      $this->addEntityFieldProcesses($migration$entity_type_id);
    }
  }

  /** * {@inheritdoc} */
  public function addEntityFieldProcesses(MigrationInterface $migration$entity_type_id) {
    $core = $this->getCoreVersion($migration);
    
/** * {@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 testGetCoreVersion(array $tags$expected_result) {
    $migration = $this->prophesize(MigrationInterface::class);
    $migration->getMigrationTags()->willReturn($tags);
    $field_discovery = new FieldDiscoveryTestClass($this->fieldPluginManager->reveal()$this->migrationPluginManager->reveal()$this->logger->reveal());
    if (!$expected_result) {
      $this->expectException(\InvalidArgumentException::class);
    }
    $actual_result = $field_discovery->getCoreVersion($migration->reveal());
    $this->assertEquals($expected_result$actual_result);
  }

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