You are here

function LegalRegisterTestCase::testRegisterSuccessful in Legal 6.8

Same name and namespace in other branches
  1. 7.2 legal.test \LegalRegisterTestCase::testRegisterSuccessful()
  2. 7 legal.test \LegalRegisterTestCase::testRegisterSuccessful()

Accept T&C to successfully create an account.

File

./legal.test, line 66
Tests for Legal module.

Class

LegalRegisterTestCase
Test registering as new user and creating an account.

Code

function testRegisterSuccessful() {

  // Prepare a user to do testing.
  $name = $this
    ->randomName();
  $mail = "{$name}@example.com";
  $edit = array(
    'name' => $name,
    'mail' => $mail,
    'legal_accept' => TRUE,
  );
  $this
    ->drupalPost('user/register', $edit, t('Create new account'));

  // Check account was created.
  $this
    ->assertText(t('Your password and further instructions have been sent to your e-mail address.'), 'Account created');
}