function HttpKernelUiHelperTrait::getSession
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/HttpKernelUiHelperTrait.php \Drupal\Tests\HttpKernelUiHelperTrait::getSession()
Returns Mink session.
The lazily initializes Mink the first time it is called.
Parameters
string $name: (optional) Name of the session. Defaults to the active session.
Return value
\Behat\Mink\Session The active Mink session object.
File
-
core/
tests/ Drupal/ Tests/ HttpKernelUiHelperTrait.php, line 111
Class
- HttpKernelUiHelperTrait
- Provides UI helper methods using the HTTP kernel to make requests.
Namespace
Drupal\TestsCode
public function getSession($name = NULL) : Session {
// Lazily initialize the Mink session. We do this because unlike Browser
// tests where there should definitely be requests made, this is not
// necessarily the case with Kernel tests.
if (!isset($this->mink)) {
$this->initMink();
// Set up the browser test output file.
$this->initBrowserOutputFile();
}
return $this->mink
->getSession($name);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.