You are here

protected function QuickEditLoadingTest::drupalPostCustom in Quick Edit 7

Perform a POST HTTP request in a non-form context.

Parameters

string $path: Drupal path where the request should be POSTed to. Will be transformed into an absolute path automatically.

string $accept: The value for the "Accept" header. Usually either 'application/json' or 'application/vnd.drupal-ajax'.

array $post: The POST data. When making a 'application/vnd.drupal-ajax' request, the Ajax page state data should be included. Use getAjaxPageStatePostData() for that.

array $options: (optional) Options to be forwarded to the url generator. The 'absolute' option will automatically be enabled.

Return value

The content returned from the call to curl_exec().

See also

WebTestBase::getAjaxPageStatePostData()

WebTestBase::curlExec()

url()

5 calls to QuickEditLoadingTest::drupalPostCustom()
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 561
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 drupalPostCustom($path, $accept, array $post, $options = array()) {
  return $this
    ->curlExec(array(
    CURLOPT_URL => url($path, $options + array(
      'absolute' => TRUE,
    )),
    CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => $this
      ->serializePostValues($post),
    CURLOPT_HTTPHEADER => array(
      'Accept: ' . $accept,
      'Content-Type: application/x-www-form-urlencoded',
    ),
  ));
}