Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@everzet
Forked from tentacode/RegistrationContext.php
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everzet/dcaf12248cadfdd8ac94 to your computer and use it in GitHub Desktop.
Save everzet/dcaf12248cadfdd8ac94 to your computer and use it in GitHub Desktop.
<?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