Skip to content
Snippets Groups Projects
Commit bd4f1792 authored by catch's avatar catch
Browse files

Issue #2640842 by heddn, quietone, juancasantito, JoshOrndorff: Make related...

Issue #2640842 by heddn, quietone, juancasantito, JoshOrndorff: Make related file migration ID configurable in d6_cck_file
parent 7ca0caf4
No related branches found
No related tags found
No related merge requests found
......@@ -50,10 +50,10 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
// Configure the migration process plugin to look up migrated IDs from
// the d6_file migration.
$migration_plugin_configuration = [
'source' => ['fid'],
// a d6 file migration.
$migration_plugin_configuration = $configuration + [
'migration' => 'd6_file',
'source' => ['fid'],
];
return new static(
......
<?php
namespace Drupal\Tests\file\Kernel\Migrate\process\d6;
use Drupal\file\Plugin\migrate\process\d6\CckFile;
use Drupal\migrate\Plugin\Migration;
use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
/**
* Cck file field migration.
*
* @coversDefaultClass \Drupal\file\Plugin\migrate\process\d6\CckFile
*
* @group file
*/
class CckFileTest extends MigrateDrupalTestBase {
/**
* Tests configurability of file migration name.
*
* @covers ::__construct
*/
public function testConfigurableFileMigration() {
$migration = Migration::create($this->container, [], 'custom_migration', []);
$cck_file_migration = CckFile::create($this->container, ['migration' => 'custom_file'], 'custom_file', [], $migration);
$migration_plugin = $this->readAttribute($cck_file_migration, 'migrationPlugin');
$config = $this->readAttribute($migration_plugin, 'configuration');
$this->assertEquals($config['migration'], 'custom_file');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment