You are here

protected function WebTestBase::getAjaxPageStatePostData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::getAjaxPageStatePostData()

Get the Ajax page state from drupalSettings and prepare it for POSTing.

Return value

array The Ajax page state POST data.

10 calls to WebTestBase::getAjaxPageStatePostData()
PreviewTest::clickPreviewLinkAJAX in core/modules/views_ui/src/Tests/PreviewTest.php
Mimic clicking on a preview link.
QuickEditAutocompleteTermTest::testAutocompleteQuickEdit in core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
Tests Quick Edit autocomplete term behavior.
QuickEditLoadingTest::testConcurrentEdit in core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
Tests Quick Edit on a node that was concurrently edited on the full node form.
QuickEditLoadingTest::testCustomPipeline in core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
Tests that Quick Edit works with custom render pipelines.
QuickEditLoadingTest::testImageField in core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
Tests that Quick Edit can handle an image field.

... See full list

File

core/modules/simpletest/src/WebTestBase.php, line 2143
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function getAjaxPageStatePostData() {
  $post = array();
  $drupal_settings = $this->drupalSettings;
  if (isset($drupal_settings['ajaxPageState']['theme'])) {
    $post['ajax_page_state[theme]'] = $drupal_settings['ajaxPageState']['theme'];
  }
  if (isset($drupal_settings['ajaxPageState']['theme_token'])) {
    $post['ajax_page_state[theme_token]'] = $drupal_settings['ajaxPageState']['theme_token'];
  }
  if (isset($drupal_settings['ajaxPageState']['libraries'])) {
    $post['ajax_page_state[libraries]'] = $drupal_settings['ajaxPageState']['libraries'];
  }
  return $post;
}