You are here

protected function BrowserTestBase::prepareRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/BrowserTestBase.php \Drupal\simpletest\BrowserTestBase::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().

See also

drupal_valid_test_ua()

2 calls to BrowserTestBase::prepareRequest()
BrowserTestBase::drupalGet in core/modules/simpletest/src/BrowserTestBase.php
Retrieves a Drupal path or an absolute path.
BrowserTestBase::submitForm in core/modules/simpletest/src/BrowserTestBase.php
Fills and submits a form.

File

core/modules/simpletest/src/BrowserTestBase.php, line 450
Contains \Drupal\simpletest\BrowserTestBase.

Class

BrowserTestBase
Provides a test case for functional Drupal tests.

Namespace

Drupal\simpletest

Code

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