diff --git a/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php b/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
index 2267726653587994d4d907697c52d51ae067d8ab..9e266b6d58ef2ac87ea13e98bbf4ad661fc158a1 100644
--- a/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
+++ b/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
@@ -32,7 +32,7 @@ trait FileFieldCreationTrait {
    * @return \Drupal\field\FieldStorageConfigInterface
    *   The file field.
    */
-  public function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $widget_settings = []) {
+  protected function createFileField($name, $entity_type, $bundle, $storage_settings = [], $field_settings = [], $widget_settings = []) {
     $field_storage = FieldStorageConfig::create([
       'entity_type' => $entity_type,
       'field_name' => $name,
@@ -61,7 +61,7 @@ public function createFileField($name, $entity_type, $bundle, $storage_settings
    * @param array $widget_settings
    *   A list of widget settings that will be added to the widget defaults.
    */
-  public function attachFileField($name, $entity_type, $bundle, $field_settings = [], $widget_settings = []) {
+  protected function attachFileField($name, $entity_type, $bundle, $field_settings = [], $widget_settings = []) {
     $field = [
       'field_name' => $name,
       'label' => $name,