Created
February 13, 2013 08:08
-
-
Save aderuwe/4943019 to your computer and use it in GitHub Desktop.
Behat metastep for logging in a user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... code snipped | |
class FeatureContext extends MinkContext implements KernelAwareInterface | |
{ | |
// ... code snipped | |
/** | |
* @Given /^I am logged in as user "([^"]*)" with password "([^"]*)"$/ | |
*/ | |
public function iAmLoggedInAsUserWithPassword($username, $password) | |
{ | |
return array( | |
new Step\Given('I am on "/login"'), | |
new Step\When(sprintf('I fill in "Username:" with "%s"', $username)), | |
new Step\When(sprintf('I fill in "Password" with "%s"', $password)), | |
new Step\When('I press "Login"'), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment