diff --git a/tests/src/Functional/EntityReferenceFieldFormatterTest.php b/tests/src/Functional/EntityReferenceFieldFormatterTest.php
index 397b2ec..b78b51d 100644
--- a/tests/src/Functional/EntityReferenceFieldFormatterTest.php
+++ b/tests/src/Functional/EntityReferenceFieldFormatterTest.php
@@ -93,7 +93,7 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase {
     // Ensure that 'Rendered Entity' plugin is not available for an entity not
     // having a view controller.
     $plugin_options = $this->container->get('plugin.manager.entity_embed.display')->getDefinitionOptionsForEntity($this->menu);
-    $this->assertFalse(array_key_exists('entity_reference:entity_reference_entity_view', $plugin_options), "The 'Rendered entity' plugin is not available.");
+    $this->assertArrayNotHasKey('entity_reference:entity_reference_entity_view', $plugin_options, "The 'Rendered entity' plugin is not available.");
   }
 
   /**
