function UiHelperTrait::assertSession

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()
  2. 10 core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()
  3. 9 core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()
  4. 8.9.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()

Returns WebAssert object.

Parameters

string $name: (optional) Name of the session. Defaults to the active session.

Return value

\Drupal\Tests\WebAssert A new web-assert option for asserting the presence of elements with.

144 calls to UiHelperTrait::assertSession()
AddedStylesheetsTest::testCkeditorStylesheets in core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php
Test the ckeditor5-stylesheets theme config.
BooleanFormatterSettingsTest::testBooleanFormatterSettings in core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
Tests the formatter settings page for the Boolean formatter.
BulkFormTest::testConfirmRouteWithParameters in core/modules/views/tests/src/Functional/BulkFormTest.php
Tests that route parameters are passed to the confirmation form route.
ComposerRequirementTest::testComposerInfoShown in core/modules/package_manager/tests/src/Functional/ComposerRequirementTest.php
Tests that Composer version and path are listed on the status report.
ConfigurableLanguageManagerTest::testUrlContentTranslationWithPreferredAdminLanguage in core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
Tests translation with URL and Preferred Admin Language negotiators.

... See full list

File

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

Class

UiHelperTrait
Provides UI helper methods.

Namespace

Drupal\Tests

Code

public function assertSession($name = NULL) {
  $this->addToAssertionCount(1);
  return new WebAssert($this->getSession($name), $this->baseUrl);
}

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