function BrowserTestBaseUserAgentTest::prepareRequest

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

Overrides UiHelperTrait::prepareRequest

File

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

Class

BrowserTestBaseUserAgentTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

protected function prepareRequest() {
    $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.