You are here

protected function QuickEditLoadingTest::getAjaxPageStatePostData in Quick Edit 7

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

Return value

array The Ajax page state POST data.

5 calls to QuickEditLoadingTest::getAjaxPageStatePostData()
QuickEditLoadingTest::testConcurrentEdit in ./quickedit.test
Tests Quick Edit with concurrent node / Quick Edit use.
QuickEditLoadingTest::testCustomPipeline in ./quickedit.test
Tests that Quick Edit works with custom render pipelines.
QuickEditLoadingTest::testTitleBaseField in ./quickedit.test
Tests the loading of Quick Edit for the title base field.
QuickEditLoadingTest::testUserWithoutPermission in ./quickedit.test
Test the loading of Quick Edit when a user doesn't have access to it.
QuickEditLoadingTest::testUserWithPermission in ./quickedit.test
Tests the loading of Quick Edit when a user does have access to it.

File

./quickedit.test, line 599
Tests loading of Quick Edit and lazy-loading of in-place editors.

Class

QuickEditLoadingTest
Tests loading of Quick Edit and lazy-loading of in-place editors.

Code

protected function getAjaxPageStatePostData() {
  $post = array();
  $drupal_settings = $this->drupalSettings;
  if (isset($drupal_settings['ajaxPageState'])) {
    $post['ajax_page_state[theme]'] = $drupal_settings['ajaxPageState']['theme'];
    $post['ajax_page_state[theme_token]'] = $drupal_settings['ajaxPageState']['theme_token'];
    foreach ($drupal_settings['ajaxPageState']['css'] as $key => $value) {
      $post["ajax_page_state[css][{$key}]"] = 1;
    }
    foreach ($drupal_settings['ajaxPageState']['js'] as $key => $value) {
      $post["ajax_page_state[js][{$key}]"] = 1;
    }
  }
  return $post;
}