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.

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.