You are here

public function MinkTest::testNotStartedSession in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/tests/MinkTest.php \Behat\Mink\Tests\MinkTest::testNotStartedSession()

File

vendor/behat/mink/tests/MinkTest.php, line 66

Class

MinkTest

Namespace

Behat\Mink\Tests

Code

public function testNotStartedSession() {
  $session = $this
    ->getSessionMock();
  $session
    ->expects($this
    ->once())
    ->method('isStarted')
    ->will($this
    ->returnValue(false));
  $session
    ->expects($this
    ->once())
    ->method('start');
  $this->mink
    ->registerSession('mock_session', $session);
  $this
    ->assertSame($session, $this->mink
    ->getSession('mock_session'));
  $this
    ->setExpectedException('InvalidArgumentException');
  $this->mink
    ->getSession('not_registered');
}