function DrupalTestBrowser::getClient

Same name in other branches
  1. 10 core/tests/Drupal/Tests/DrupalTestBrowser.php \Drupal\Tests\DrupalTestBrowser::getClient()
  2. 11.x 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;
}

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