protected function LingotekTestBase::getHttpClient in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.1.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.2.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.3.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.4.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.5.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.6.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.7.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
- 3.8.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::getHttpClient()
Obtain the HTTP client and set the cookies.
Return value
\GuzzleHttp\Client The client with BrowserTestBase configuration.
Overrides BrowserTestBase::getHttpClient
1 call to LingotekTestBase::getHttpClient()
- LingotekTestBase::setUp in tests/
src/ Functional/ LingotekTestBase.php
File
- tests/
src/ Functional/ LingotekTestBase.php, line 548
Class
- LingotekTestBase
- Base class for Lingotek test. Performs authorization of the account.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function getHttpClient() {
// Similar code is also employed to test CSRF tokens.
// @see \Drupal\Tests\system\Functional\CsrfRequestHeaderTest::testRouteAccess()
$domain = parse_url($this
->getUrl(), PHP_URL_HOST);
$session_id = $this
->getSession()
->getCookie($this
->getSessionName());
$this->cookies = CookieJar::fromArray([
$this
->getSessionName() => $session_id,
], $domain);
return $this
->getSession()
->getDriver()
->getClient()
->getClient();
}