You are here

public function Mink::getSession in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Mink.php \Behat\Mink\Mink::getSession()

Returns registered session by it's name or active one and automatically starts it if required.

Parameters

string $name session name:

Return value

Session

Throws

\InvalidArgumentException If the named session is not registered

1 call to Mink::getSession()
Mink::assertSession in vendor/behat/mink/src/Mink.php
Returns session asserter.

File

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

Class

Mink
Mink sessions manager.

Namespace

Behat\Mink

Code

public function getSession($name = null) {
  $session = $this
    ->locateSession($name);

  // start session if needed
  if (!$session
    ->isStarted()) {
    $session
      ->start();
  }
  return $session;
}