function UiHelperTrait::prepareRequest

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::prepareRequest()
  2. 10 core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::prepareRequest()
  3. 11.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::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()

5 calls to UiHelperTrait::prepareRequest()
BrowserWithJavascriptTest::drupalGetWithAlert in core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php
Retrieves a Drupal path or an absolute path.
QuickEditImageControllerTest::uploadImage in core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php
Uploads an image using the image module's Quick Edit route.
QuickEditImageTest::testImageInPlaceEditor in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php
Tests that quick editor works correctly with images.
UiHelperTrait::drupalGet in core/tests/Drupal/Tests/UiHelperTrait.php
Retrieves a Drupal path or an absolute path.
UiHelperTrait::submitForm in core/tests/Drupal/Tests/UiHelperTrait.php
Fills and submits a form.
1 method overrides UiHelperTrait::prepareRequest()
BrowserTestBaseUserAgentTest::prepareRequest in core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php
Prepare for a request to testing site.

File

core/tests/Drupal/Tests/UiHelperTrait.php, line 439

Class

UiHelperTrait
Provides UI helper methods.

Namespace

Drupal\Tests

Code

protected function prepareRequest() {
    $session = $this->getSession();
    $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.