You are here

public function DrupalTestBrowser::getClient in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/DrupalTestBrowser.php \Drupal\Tests\DrupalTestBrowser::getClient()

Gets the Guzzle client.

Return value

\GuzzleHttp\ClientInterface The Guzzle client.

File

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

Class

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

Namespace

Drupal\Tests

Code

public function getClient() {
  if (!$this->client) {
    $this->client = new Client([
      'allow_redirects' => FALSE,
      'cookies' => TRUE,
    ]);
  }
  return $this->client;
}