-
-
Save everzet/dcaf12248cadfdd8ac94 to your computer and use it in GitHub Desktop.
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 | |
use Behat\Behat\Context\Context; | |
namespace Context; | |
class RegistrationContext implements Context | |
{ | |
/** | |
* @When I go to the registration page | |
*/ | |
public function iGoToTheRegistrationPage() | |
{ | |
$this->visit('/inscription'); | |
} | |
/** | |
* @When I register with :email as email | |
* @When I register with :nickname as nickname | |
* @When I register with :password as password | |
*/ | |
public function iRegisterWith($email = 'foo@bar.com', $nickname = 'FooBar', $password = 'foobar1337') | |
{ | |
$this->iGoToTheRegistrationPage(); | |
$this->fillField('register_email', $email); | |
$this->fillField('register_person_nickname', $nickname); | |
$this->fillField('register_plainPassword_first', $password); | |
$this->fillField('register_plainPassword_second', $password); | |
$this->pressButton('register_registerButton'); | |
} | |
/** | |
* @When I register with an empty form | |
*/ | |
public function iRegisterWithAnEmptyForm() | |
{ | |
$this->iRegisterWith('', '', ''); | |
} | |
} | |
$test = new Context(); | |
$test->iGoToTheRegistrationPage(); | |
$test->iRegisterWith('ever.zet@gmail.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment