You are here

function LegalRegisterTestCase::testRegisterUnsuccessful in Legal 7.2

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

Don't accept T&C no account created.

File

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

Class

LegalRegisterTestCase
Test registering as new user and creating an account.

Code

function testRegisterUnsuccessful() {

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

  // Check account wasn't created.
  $this
    ->assertText(t('Accept Terms & Conditions of Use field is required.'), 'T&C not accepted, account not created');
}