You are here

public function DrupalTestBrowser::getClient in Drupal 10

Same name and namespace in other branches
  1. 9 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;
}