Commit 77043e42 authored by catch's avatar catch

Issue #2850312 by heddn, Charlotte17, ohthehugemanatee, Gribnif, mikeryan,...

Issue #2850312 by heddn, Charlotte17, ohthehugemanatee, Gribnif, mikeryan, kubrt, Jo Fitzgerald, michaelmallett, phenaproxima: d6_filter_format is hard coded, causing dependent migration to fail
parent 85ee07cc
......@@ -40,12 +40,16 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
$migration_plugin_configuration = $configuration + [
'migration' => 'd6_filter_format',
];
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$migration,
$container->get('plugin.manager.migrate.process')->createInstance('migration', ['migration' => 'd6_filter_format'], $migration)
$container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_plugin_configuration, $migration)
);
}
......
<?php
namespace Drupal\Tests\filter\Kernel\Migrate\d6;
use Drupal\filter\Plugin\migrate\process\d6\FilterFormatPermission;
use Drupal\migrate\Plugin\Migration;
use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
/**
* Tests conversion of format serial to string id in permission name.
*
* @coversDefaultClass \Drupal\filter\Plugin\migrate\process\d6\FilterFormatPermission
*
* @group filter
*/
class FilterFormatPermissionTest extends MigrateDrupalTestBase {
/**
* Tests configurability of filter_format migration name.
*
* @covers ::__construct
*/
public function testConfigurableFilterFormat() {
$migration = Migration::create($this->container, [], 'custom_migration', []);
$filterFormatPermissionMigration = FilterFormatPermission::create($this->container, ['migration' => 'custom_filter_format'], 'custom_filter_format', [], $migration);
$migrationPlugin = $this->readAttribute($filterFormatPermissionMigration, 'migrationPlugin');
$config = $this->readAttribute($migrationPlugin, 'configuration');
$this->assertEquals($config['migration'], 'custom_filter_format');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment