diff --git a/core/modules/field/src/Tests/Uri/UriItemTest.php b/core/modules/field/src/Tests/Uri/UriItemTest.php
index 46ffe0a..9dc50a2 100644
--- a/core/modules/field/src/Tests/Uri/UriItemTest.php
+++ b/core/modules/field/src/Tests/Uri/UriItemTest.php
@@ -68,6 +68,11 @@ public function testUriField() {
         'type' => 'uri',
       ])
       ->save();
+
+    // Test the generateSampleValue() method.
+    $entity = entity_create('entity_test');
+    $entity->$field_name->generateSampleItems();
+    $this->entityValidateAndSave($entity);
   }
 
 }
