Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.