function HttpKernelUiHelperTrait::assertSession

Same name and namespace in other branches
  1. 11.x 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.

3 calls to HttpKernelUiHelperTrait::assertSession()
ElementsContainerTest::testOptionalContainerElements in core/modules/system/tests/src/Kernel/Form/ElementsContainerTest.php
Tests the #optional container property.
ImageLoadingAttributeTest::testImageLoadingAttribute in core/modules/system/tests/src/Kernel/Theme/ImageLoadingAttributeTest.php
Tests that loading attribute is enabled for images.
TwigEnvironmentTest::testTwigEmbed in core/modules/system/tests/src/Kernel/Theme/TwigEnvironmentTest.php
Tests template class loading with Twig embed.

File

core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php, line 216

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.