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. 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.

14 calls to UiHelperTrait::assertSession()
CredentialFormTest::testCredentialFrom in core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
Test the credential form.
DrupalMessengerServiceTest::testDrupalMessengerService in core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
Tests Messenger service.
NestedFormTest::testNestedEntityFormEntityLevelValidation in core/modules/field/tests/src/Functional/NestedFormTest.php
Tests entity level validation within subforms.
PathNodeFormTest::testNodeForm in core/modules/path/tests/src/Functional/PathNodeFormTest.php
Tests the node form ui.
PlaceholderMessageTest::testMessagePlaceholder in core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php
Tests rendering of message placeholder.

... See full list

File

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

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.