diff -u b/core/modules/filter/migration_templates/d7_filter_format.yml b/core/modules/filter/migration_templates/d7_filter_format.yml --- b/core/modules/filter/migration_templates/d7_filter_format.yml +++ b/core/modules/filter/migration_templates/d7_filter_format.yml @@ -14,7 +14,14 @@ source: filters key: '@id' process: - id: name + id: + plugin: static_map + bypass: true + source: name + map: + # Change the php_code filter to filter_null; other filters can pass + # through unmodified. + php_code: filter_null settings: plugin: filter_settings source: settings only in patch2: unchanged: --- a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php +++ b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php @@ -42,13 +42,13 @@ protected function setUp() { protected function assertEntity($id, $label, array $enabled_filters, $weight) { /** @var \Drupal\filter\FilterFormatInterface $entity */ $entity = FilterFormat::load($id); - $this->assertTrue($entity instanceof FilterFormatInterface); - $this->assertIdentical($label, $entity->label()); + $this->assertInstanceOf(FilterFormatInterface::class, $entity); + $this->assertSame($label, $entity->label()); // get('filters') will return enabled filters only, not all of them. - $this->assertIdentical(array_keys($enabled_filters), array_keys($entity->get('filters'))); - $this->assertIdentical($weight, $entity->get('weight')); + $this->assertSame(array_keys($enabled_filters), array_keys($entity->get('filters'))); + $this->assertSame($weight, $entity->get('weight')); foreach ($entity->get('filters') as $filter_id => $filter) { - $this->assertIdentical($filter['weight'], $enabled_filters[$filter_id]); + $this->assertSame($filter['weight'], $enabled_filters[$filter_id]); } } @@ -68,15 +68,17 @@ public function testFilterFormat() { // Ensure that filter-specific settings were migrated. /** @var \Drupal\filter\FilterFormatInterface $format */ $format = FilterFormat::load('filtered_html'); + $this->assertInstanceOf(FilterFormatInterface::class, $format); $config = $format->filters('filter_html')->getConfiguration(); - $this->assertIdentical('