function HttpKernelUiHelperTrait::assertSession

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php \Drupal\Tests\HttpKernelUiHelperTrait::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/HttpKernelUiHelperTrait.php, line 166

Class

HttpKernelUiHelperTrait
Provides UI helper methods using the HTTP kernel to make requests.

Namespace

Drupal\Tests

Code

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

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