protected function EditLoadingTest::retrieveFieldForm

Retrieve field form from the server. May also result in additional JavaScript settings and CSS/JS being loaded.

Parameters

string $field_id: An Edit field ID.

Return value

string The response body.

1 call to EditLoadingTest::retrieveFieldForm()

File

drupal/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php, line 238
Contains \Drupal\edit\Tests\EditLoadingTest.

Class

EditLoadingTest
Tests loading of Edit and lazy-loading of in-place editors.

Namespace

Drupal\edit\Tests

Code

protected function retrieveFieldForm($field_id) {

  // Build & serialize POST value.
  $post = urlencode('nocssjs') . '=' . urlencode('true');

  // Perform HTTP request.
  return $this
    ->curlExec(array(
    CURLOPT_URL => url('edit/form/' . $field_id, array(
      'absolute' => TRUE,
    )),
    CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => $post . $this
      ->getAjaxPageStatePostData(),
    CURLOPT_HTTPHEADER => array(
      'Accept: application/vnd.drupal-ajax',
      'Content-Type: application/x-www-form-urlencoded',
    ),
  ));
}