diff --git a/core/modules/comment/src/Tests/CommentInterfaceTest.php b/core/modules/comment/src/Tests/CommentInterfaceTest.php
index b1dc51d..1043c67 100644
--- a/core/modules/comment/src/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/src/Tests/CommentInterfaceTest.php
@@ -10,6 +10,7 @@
 use Drupal\comment\CommentManagerInterface;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\comment\Entity\Comment;
+use Drupal\filter\Entity\FilterFormat;
 
 /**
  * Tests comment user interfaces.
@@ -235,15 +236,15 @@ public function testAutoFilledSubject() {
    */
   public function testAutoFilledHtmlSubject() {
     // Set up two default (i.e. filtered HTML) input formats, because then we
-    // can select one of them (there's probably a better way of doing this).
-    // Then create a user that can use these formats, log the user in, and then
-    // GET the node page on which to test the comments.
-    $filtered_html_format = entity_create('filter_format', array(
+    // can select one of them. Then create a user that can use these formats,
+    // log the user in, and then GET the node page on which to test the
+    // comments.
+    $filtered_html_format = FilterFormat::create(array(
       'format' => 'filtered_html',
       'name' => 'Filtered HTML',
     ));
     $filtered_html_format->save();
-    $full_html_format = entity_create('filter_format', array(
+    $full_html_format = FilterFormat::create(array(
       'format' => 'full_html',
       'name' => 'Full HTML',
     ));
