decorateWithXdebugCookie example


  protected function makeApiRequest($method, Url $url, array $request_options) {
    $this->refreshVariables();
    $request_options[RequestOptions::HTTP_ERRORS] = FALSE;
    $request_options[RequestOptions::ALLOW_REDIRECTS] = FALSE;
    $request_options = $this->decorateWithXdebugCookie($request_options);
    $client = $this->getSession()->getDriver()->getClient()->getClient();
    return $client->request($method$url->setAbsolute(TRUE)->toString()$request_options);
  }

  /** * Adds the Xdebug cookie to the request options. * * @param array $request_options * The request options. * * @return array * Request options updated with the Xdebug cookie if present. */

  protected function request($method, Url $url, array $request_options) {
    $request_options[RequestOptions::HTTP_ERRORS] = FALSE;
    $request_options[RequestOptions::ALLOW_REDIRECTS] = FALSE;
    $request_options = $this->decorateWithXdebugCookie($request_options);
    $client = $this->getHttpClient();
    return $client->request($method$url->setAbsolute(TRUE)->toString()$request_options);
  }

  /** * Asserts that a resource response has the given status code and body. * * @param int $expected_status_code * The expected response status. * @param string|false $expected_body * The expected response body. FALSE in case this should not be asserted. * @param \Psr\Http\Message\ResponseInterface $response * The response to assert. * @param string[]|false $expected_cache_tags * (optional) The expected cache tags in the X-Drupal-Cache-Tags response * header, or FALSE if that header should be absent. Defaults to FALSE. * @param string[]|false $expected_cache_contexts * (optional) The expected cache contexts in the X-Drupal-Cache-Contexts * response header, or FALSE if that header should be absent. Defaults to * FALSE. * @param string|false $expected_page_cache_header_value * (optional) The expected X-Drupal-Cache response header value, or FALSE if * that header should be absent. Possible strings: 'MISS', 'HIT'. Defaults * to FALSE. * @param string|false $expected_dynamic_page_cache_header_value * (optional) The expected X-Drupal-Dynamic-Cache response header value, or * FALSE if that header should be absent. Possible strings: 'MISS', 'HIT'. * Defaults to FALSE. */
Home | Imprint | This part of the site doesn't use cookies.