You are here

function LegalRegisterTestCase::testRegisterSuccessful in Legal 7.2

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

Accept T&C to successfully create an account.

File

./legal.test, line 65
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('Thank you for applying for an account. Your account is currently pending approval by the site administrator.'), 'Account created');
}