summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2015-04-15 12:31:39 (GMT)
committerwebchick2015-04-15 12:31:39 (GMT)
commitee12606d08db353be91d7bc9fa02c70917aca4c0 (patch)
treec0280e9f4bc7849caf3c6ffc8e7ae4dd84cfbcf3
parentca3422f1ee0184d81cea0ad25c5ebb4dbde4ef4a (diff)
Issue #2467887 by joshi.rohit100: Rename drupalGetAJAX to drupalGetAjax for parity with drupalPostAjaxForm
-rw-r--r--core/modules/menu_ui/src/Tests/MenuTest.php4
-rw-r--r--core/modules/simpletest/src/WebTestBase.php2
-rw-r--r--core/modules/system/src/Tests/Ajax/DialogTest.php8
-rw-r--r--core/modules/system/src/Tests/Ajax/FrameworkTest.php4
-rw-r--r--core/modules/system/src/Tests/Form/StorageTest.php4
-rw-r--r--core/modules/system/src/Tests/Routing/RouterTest.php2
6 files changed, 12 insertions, 12 deletions
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index 9834792..722548f 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -864,13 +864,13 @@ class MenuTest extends MenuWebTestBase {
$admin = $this->drupalCreateUser(array('administer menu'));
$this->drupalLogin($admin);
// Just check access to the callback overall, the POST data is irrelevant.
- $this->drupalGetAJAX('admin/structure/menu/parents');
+ $this->drupalGetAjax('admin/structure/menu/parents');
$this->assertResponse(200);
// Do standard user tests.
// Login the user.
$this->drupalLogin($this->authenticatedUser);
- $this->drupalGetAJAX('admin/structure/menu/parents');
+ $this->drupalGetAjax('admin/structure/menu/parents');
$this->assertResponse(403);
}
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 1ae8e58..8e29d46 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1542,7 +1542,7 @@ abstract class WebTestBase extends TestBase {
/**
* Requests a Drupal path in drupal_ajax format and JSON-decodes the response.
*/
- protected function drupalGetAJAX($path, array $options = array(), array $headers = array()) {
+ protected function drupalGetAjax($path, array $options = array(), array $headers = array()) {
$headers[] = 'Accept: application/vnd.drupal-ajax';
return Json::decode($this->drupalGet($path, $options, $headers));
}
diff --git a/core/modules/system/src/Tests/Ajax/DialogTest.php b/core/modules/system/src/Tests/Ajax/DialogTest.php
index 37bf06c..482e025 100644
--- a/core/modules/system/src/Tests/Ajax/DialogTest.php
+++ b/core/modules/system/src/Tests/Ajax/DialogTest.php
@@ -93,7 +93,7 @@ class DialogTest extends AjaxTestBase {
$this->assertRaw($dialog_contents, 'Non-JS modal dialog page present.');
// Emulate going to the JS version of the page and check the JSON response.
- $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-contents', array(), array('Accept: application/vnd.drupal-modal'));
+ $ajax_result = $this->drupalGetAjax('ajax-test/dialog-contents', array(), array('Accept: application/vnd.drupal-modal'));
$this->assertEqual($modal_expected_response, $ajax_result[3], 'Modal dialog JSON response matches.');
// Check that requesting a "normal" dialog without JS goes to a page.
@@ -127,7 +127,7 @@ class DialogTest extends AjaxTestBase {
// Emulate closing the dialog via an AJAX request. There is no non-JS
// version of this test.
- $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-close');
+ $ajax_result = $this->drupalGetAjax('ajax-test/dialog-close');
$this->assertEqual($close_expected_response, $ajax_result[0], 'Close dialog JSON response matches.');
// Test submitting via a POST request through the button for modals. This
@@ -159,7 +159,7 @@ class DialogTest extends AjaxTestBase {
$this->assertTrue(!empty($form), 'Non-JS form page present.');
// Emulate going to the JS version of the form and check the JSON response.
- $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-form', array(), array('Accept: application/vnd.drupal-modal'));
+ $ajax_result = $this->drupalGetAjax('ajax-test/dialog-form', array(), array('Accept: application/vnd.drupal-modal'));
$expected_ajax_settings = [
'edit-preview' => [
'callback' => '::preview',
@@ -188,7 +188,7 @@ class DialogTest extends AjaxTestBase {
$this->assertTrue(!empty($form), 'Non-JS entity form page present.');
// Emulate going to the JS version of the form and check the JSON response.
- $ajax_result = $this->drupalGetAJAX('admin/structure/contact/add', array(), array('Accept: application/vnd.drupal-modal'));
+ $ajax_result = $this->drupalGetAjax('admin/structure/contact/add', array(), array('Accept: application/vnd.drupal-modal'));
$this->setRawContent($ajax_result[3]['data']);
// Remove the data, the form build id and token will never match.
unset($ajax_result[3]['data']);
diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
index 85e9d8f..52787c9 100644
--- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
@@ -26,7 +26,7 @@ class FrameworkTest extends AjaxTestBase {
*/
public function testAJAXRender() {
// Verify that settings command is generated if JavaScript settings exist.
- $commands = $this->drupalGetAJAX('ajax-test/render');
+ $commands = $this->drupalGetAjax('ajax-test/render');
$expected = new SettingsCommand(array('ajax' => 'test'), TRUE);
$this->assertCommand($commands, $expected->render(), '\Drupal\Core\Ajax\AjaxResponse::ajaxRender() loads JavaScript settings.');
}
@@ -86,7 +86,7 @@ class FrameworkTest extends AjaxTestBase {
$edit = array(
'message' => 'Custom error message.',
);
- $commands = $this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit));
+ $commands = $this->drupalGetAjax('ajax-test/render-error', array('query' => $edit));
$expected = new AlertCommand($edit['message']);
$this->assertCommand($commands, $expected->render(), 'Custom error message is output.');
}
diff --git a/core/modules/system/src/Tests/Form/StorageTest.php b/core/modules/system/src/Tests/Form/StorageTest.php
index f77c567..64a9983 100644
--- a/core/modules/system/src/Tests/Form/StorageTest.php
+++ b/core/modules/system/src/Tests/Form/StorageTest.php
@@ -219,7 +219,7 @@ class StorageTest extends WebTestBase {
$build_id = (string) $build_id_fields[0]['value'];
// Try to poison the form cache.
- $original = $this->drupalGetAJAX('form-test/form-storage-legacy/' . $build_id);
+ $original = $this->drupalGetAjax('form-test/form-storage-legacy/' . $build_id);
$this->assertEqual($original['form']['#build_id_old'], $build_id, 'Original build_id was recorded');
$this->assertNotEqual($original['form']['#build_id'], $build_id, 'New build_id was generated');
@@ -229,7 +229,7 @@ class StorageTest extends WebTestBase {
$this->assert($status, 'A watchdog message was logged by \Drupal::formBuilder()->setCache');
// Ensure that the form state was not poisoned by the preceding call.
- $original = $this->drupalGetAJAX('form-test/form-storage-legacy/' . $build_id);
+ $original = $this->drupalGetAjax('form-test/form-storage-legacy/' . $build_id);
$this->assertEqual($original['form']['#build_id_old'], $build_id, 'Original build_id was recorded');
$this->assertNotEqual($original['form']['#build_id'], $build_id, 'New build_id was generated');
$this->assert(empty($original['form']['#poisoned']), 'Original form structure was preserved');
diff --git a/core/modules/system/src/Tests/Routing/RouterTest.php b/core/modules/system/src/Tests/Routing/RouterTest.php
index b03b194..e0a4f34 100644
--- a/core/modules/system/src/Tests/Routing/RouterTest.php
+++ b/core/modules/system/src/Tests/Routing/RouterTest.php
@@ -212,7 +212,7 @@ class RouterTest extends WebTestBase {
public function testControllerResolutionAjax() {
// This will fail with a JSON parse error if the request is not routed to
// The correct controller.
- $this->drupalGetAJAX('/router_test/test10');
+ $this->drupalGetAjax('/router_test/test10');
$this->assertEqual($this->drupalGetHeader('Content-Type'), 'application/json', 'Correct mime content type was returned');