function BrowserTestBaseUserAgentTest::prepareRequest

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php \Drupal\FunctionalTests\BrowserTestBaseUserAgentTest::prepareRequest()
  2. 8.9.x core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php \Drupal\FunctionalTests\BrowserTestBaseUserAgentTest::prepareRequest()
  3. 10 core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php \Drupal\FunctionalTests\BrowserTestBaseUserAgentTest::prepareRequest()

Overrides UiHelperTrait::prepareRequest

File

core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php, line 65

Class

BrowserTestBaseUserAgentTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

protected function prepareRequest() : void {
    $session = $this->getSession();
    if ($this->agent) {
        $session->setCookie('SIMPLETEST_USER_AGENT', $this->agent);
    }
    else {
        $session->setCookie('SIMPLETEST_USER_AGENT', drupal_generate_test_ua($this->databasePrefix));
    }
}

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