Drupal Behat logout
So you need for whatever reason to take you current user, logout, and login as a different user. For example seeing if content made by one user can be edited by another, etc etc.
There is no clear "logout" step. There however, are the following contexts:
/**
* @Given I am an anonymous user
* @Given I am not logged in
*/
public function assertAnonymousUser() {
// Verify the user is logged out.
if ($this->loggedIn()) {
$this->logout();
}
}
This would obviously benefit from a patch allowing you to write something such as "then I logout", so I wrote a patch and submitted it here... but for now you've got something that works.