duan7007
2016-05-14 18:40
浏览 30
已采纳

Mink不会切换回会话?

$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.)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douruanfan3030 2016-06-10 15:03
    已采纳

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

    Use new driver with:

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

    点赞 打赏 评论

相关推荐 更多相似问题