0
$driver = clone $this->mink->getSession()->getDriver();
$driver->reset();
$this->mink->registerSession('new', new Session($driver));
$this->mink->setDefaultSessionName('new');
// Do things.

// Switch back to the original.
$this->mink->setDefaultSessionName('default');

Well, it didn't switch back, my passing test became a failing one. As you can see the session name originally was default. (This is not Drupal specific at all so it doesn't really belong on drupal SE.)

chx
  • 11,270
  • 7
  • 55
  • 129

1 Answers1

0

Don't use $this->mink->getSession()->getDriver()

Use new driver with:

$session = new Session(new GoutteDriver()); $this->getMink()->registerSession('new', $session);

Mirso
  • 16
  • 2