function DrupalTestBrowser::createResponse

Same name in other branches
  1. 10 core/tests/Drupal/Tests/DrupalTestBrowser.php \Drupal\Tests\DrupalTestBrowser::createResponse()
  2. 11.x core/tests/Drupal/Tests/DrupalTestBrowser.php \Drupal\Tests\DrupalTestBrowser::createResponse()

Converts a Guzzle response to a BrowserKit response.

Parameters

\Psr\Http\Message\ResponseInterface $response: The Guzzle response.

Return value

\Symfony\Component\BrowserKit\Response A BrowserKit Response instance.

1 call to DrupalTestBrowser::createResponse()
DrupalTestBrowser::doRequest in core/tests/Drupal/Tests/DrupalTestBrowser.php

File

core/tests/Drupal/Tests/DrupalTestBrowser.php, line 238

Class

DrupalTestBrowser
Enables a BrowserKitDriver mink driver to use a Guzzle client.

Namespace

Drupal\Tests

Code

protected function createResponse(ResponseInterface $response) {
    return new Response((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.