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 e0952b8..c60449c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php @@ -39,7 +39,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 eee24f3..9afc3c5 100644 --- a/core/modules/system/tests/modules/ajax_test/ajax_test.module +++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module @@ -90,31 +90,6 @@ function ajax_test_error() { } /** - * 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( - '#title' => 'AJAX Dialog contents', - '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 ac0399f..ba29d2d 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; } /**