diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
index 6b9ee68..cf047ad 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SettingsRewriteTest.php
@@ -123,7 +123,7 @@ function testDrupalRewriteSettings() {
       'expected' => '$no_index = true;'
     );
     // Make an empty file.
-    $filename = settings()->get('file_public_path', conf_path() . '/files') . '/mock_settings.php';
+    $filename = Settings::get('file_public_path', conf_path() . '/files') . '/mock_settings.php';
     file_put_contents(DRUPAL_ROOT . '/' . $filename, "");
 
     // Write the setting to the file.
