diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
index 2967517..db30a1a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
@@ -41,7 +41,7 @@ public function testDialog() {
     $this->drupalGet('ajax-test/dialog');
 
     // Set up variables for this test.
-    $dialog_renderable = ajax_test_dialog_contents();
+    $dialog_renderable = \Drupal\ajax_test\Controller\AjaxTestController::dialogContents();
     $dialog_contents = drupal_render($dialog_renderable);
     $modal_expected_response = array(
       'command' => 'openDialog',
diff --git a/core/modules/system/tests/modules/ajax_test/ajax_test.module b/core/modules/system/tests/modules/ajax_test/ajax_test.module
index 2ea9eb9..3f26bcc 100644
--- a/core/modules/system/tests/modules/ajax_test/ajax_test.module
+++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module
@@ -247,7 +247,7 @@ function ajax_test_dialog_form_callback_nonmodal($form, &$form_state) {
  *   (optional) TRUE if modal, FALSE if plain dialog. Defaults to FALSE.
  */
 function _ajax_test_dialog($is_modal = FALSE) {
-  $content = ajax_test_dialog_contents();
+  $content = \Drupal\ajax_test\Controller\AjaxTestController::dialogContents();
   $response = new AjaxResponse();
   $title = t('AJAX Dialog contents');
   $html = drupal_render($content);
@@ -262,30 +262,6 @@ function _ajax_test_dialog($is_modal = FALSE) {
 }
 
 /**
- * Returns example content for dialog tests.
- */
-function ajax_test_dialog_contents() {
-  // This is a regular render array; the keys do not have special meaning.
-  $content = array(
-    'content' => array(
-      '#markup' => 'Example message',
-    ),
-    'cancel' => array(
-      '#type' => 'link',
-      '#title' => 'Cancel',
-      '#href' => '',
-      '#attributes' => array(
-        // This is a special class to which JavaScript assigns dialog closing
-        // behavior.
-        'class' => array('dialog-cancel'),
-      ),
-    ),
-  );
-
-  return $content;
-}
-
-/**
  * Menu callback: Close the ajax dialog.
  *
  * @deprecated \Drupal\ajax_test\Controller\AjaxTestController::dialogClose()
diff --git a/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/Controller/AjaxTestController.php b/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/Controller/AjaxTestController.php
index b6d5be0..933706c 100644
--- a/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/Controller/AjaxTestController.php
+++ b/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/Controller/AjaxTestController.php
@@ -15,9 +15,25 @@ class AjaxTestController {
   /**
    * Returns example content for dialog testing.
    */
-  public function dialogContents() {
-    // Re-use the utility method that returns the example content.
-    return ajax_test_dialog_contents();
+  public static function dialogContents() {
+    // This is a regular render array; the keys do not have special meaning.
+    $content = array(
+      'content' => array(
+        '#markup' => 'Example message',
+      ),
+      'cancel' => array(
+        '#type' => 'link',
+        '#title' => 'Cancel',
+        '#href' => '',
+        '#attributes' => array(
+          // This is a special class to which JavaScript assigns dialog closing
+          // behavior.
+          'class' => array('dialog-cancel'),
+        ),
+      ),
+    );
+
+    return $content;
   }
 
   /**
