Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Mink.php

function Mink::locateSession

Returns the named or default session without starting it.

Parameters

string|null $name session name:

Return value

Session

Throws

\InvalidArgumentException If the named session is not registered

2 calls to Mink::locateSession()
Mink::getSession in vendor/behat/mink/src/Mink.php
Returns registered session by its name or default one.
Mink::isSessionStarted in vendor/behat/mink/src/Mink.php
Checks whether a named session (or the default session) has already been started.

File

vendor/behat/mink/src/Mink.php, line 206

Class

Mink
Mink session manager.

Namespace

Behat\Mink

Code

protected function locateSession(?string $name = null) {
    $name = $name ? strtolower($name) : $this->defaultSessionName;
    if (null === $name) {
        throw new \InvalidArgumentException('Specify session name to get');
    }
    if (!isset($this->sessions[$name])) {
        throw new \InvalidArgumentException(sprintf('Session "%s" is not registered.', $name));
    }
    $session = $this->sessions[$name];
    return $session;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal