Skip to content

Instantly share code, notes, and snippets.

@nedSaf
Created November 30, 2014 10:34
Show Gist options
  • Save nedSaf/54f6756fdfbc8f232560 to your computer and use it in GitHub Desktop.
Save nedSaf/54f6756fdfbc8f232560 to your computer and use it in GitHub Desktop.
Login custom function for behat
/**
* Authenticates a user with password from configuration.
*
* @Given /^I am logged in as user "([^"]*)"$/
*/
public function iAmLoggedInAsUser($username) {
$this->user = new stdClass();
$this->user->name = $username;
$this->user->pass = $this->drupal_users[$username];
$this->login();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment