diff --git a/core/modules/filter/migration_templates/d6_filter_format.yml b/core/modules/filter/migration_templates/d6_filter_format.yml
index 6b767f2..07b98d9 100644
--- a/core/modules/filter/migration_templates/d6_filter_format.yml
+++ b/core/modules/filter/migration_templates/d6_filter_format.yml
@@ -17,7 +17,6 @@ process:
     process:
       id:
         plugin: static_map
-        default_value: filter_null
         source:
           - module
           - delta
@@ -28,6 +27,8 @@ process:
             - filter_url
             - filter_htmlcorrector
             - filter_html_escape
+          php:
+            - filter_null
       settings:
         plugin: filter_settings
         source: settings
diff --git a/core/modules/filter/migration_templates/d7_filter_format.yml b/core/modules/filter/migration_templates/d7_filter_format.yml
index 2b44a80..71609ac 100644
--- a/core/modules/filter/migration_templates/d7_filter_format.yml
+++ b/core/modules/filter/migration_templates/d7_filter_format.yml
@@ -19,6 +19,8 @@ process:
         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
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
index ed5f0fb..3b2e8d7 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\filter\Kernel\Migrate\d6;
 
 use Drupal\filter\Entity\FilterFormat;
+use Drupal\filter\FilterFormatInterface;
 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
 
 /**
@@ -39,14 +40,16 @@ public function testFilterFormat() {
     $this->assertFalse(isset($filters['filter_html_image_secure']));
 
     // Check variables migrated into filter.
-    $this->assertIdentical('<a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>', $filters['filter_html']['settings']['allowed_html']);
-    $this->assertIdentical(TRUE, $filters['filter_html']['settings']['filter_html_help']);
-    $this->assertIdentical(FALSE, $filters['filter_html']['settings']['filter_html_nofollow']);
-    $this->assertIdentical(72, $filters['filter_url']['settings']['filter_url_length']);
+    $this->assertSame('<a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>', $filters['filter_html']['settings']['allowed_html']);
+    $this->assertSame(TRUE, $filters['filter_html']['settings']['filter_html_help']);
+    $this->assertSame(FALSE, $filters['filter_html']['settings']['filter_html_nofollow']);
+    $this->assertSame(72, $filters['filter_url']['settings']['filter_url_length']);
 
     // Check that the PHP code filter is converted to filter_null.
-    $filters = FilterFormat::load('php_code')->get('filters');
-    $this->assertTrue(isset($filters['filter_null']));
+    /** @var FilterFormatInterface $format */
+    $format = FilterFormat::load('php_code');
+    $this->assertInstanceOf(FilterFormatInterface::class, $format);
+    $this->assertArrayHasKey('filter_null', $format->get('filters'));
   }
 
 }
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
index 8eb13b9..e4053ae 100644
--- 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('<div> <span> <ul type> <li> <ol start type> <a href hreflang> <img src alt height width>', $config['settings']['allowed_html']);
+    $this->assertSame('<div> <span> <ul type> <li> <ol start type> <a href hreflang> <img src alt height width>', $config['settings']['allowed_html']);
     $config = $format->filters('filter_url')->getConfiguration();
-    $this->assertIdentical(128, $config['settings']['filter_url_length']);
+    $this->assertSame(128, $config['settings']['filter_url_length']);
 
     // The php_code format gets migrated, but the php_code filter is changed to
     // filter_null.
-    $filters = FilterFormat::load('php_code')->get('filters');
-    $this->assertTrue(isset($filters['filter_null']));
+    $format = FilterFormat::load('php_code');
+    $this->assertInstanceOf(FilterFormatInterface::class, $format);
+    $this->assertArrayHasKey('filter_null', $format->get('filters'));
   }
 
 }
