protected function BrowserTestBaseUserAgentTest::prepareRequest in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php \Drupal\FunctionalTests\BrowserTestBaseUserAgentTest::prepareRequest()
- 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php \Drupal\FunctionalTests\BrowserTestBaseUserAgentTest::prepareRequest()
Prepare for a request to testing site.
The testing site is protected via a SIMPLETEST_USER_AGENT cookie that is checked by drupal_valid_test_ua().
Overrides UiHelperTrait::prepareRequest
See also
File
- core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseUserAgentTest.php, line 63
Class
- BrowserTestBaseUserAgentTest
- Tests BrowserTestBase functionality.
Namespace
Drupal\FunctionalTestsCode
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));
}
}