Commit e09959d9 authored by greggles's avatar greggles

task #485778 by greggles: simpletests for email registration

parent 9f9732ff
<?php
class EmailRegistrationTestCase extends DrupalWebTestCase {
/**
* Implementation of getInfo().
*/
public static function getInfo() {
return array(
'name' => t('Email registration.'),
'description' => t('Test the email registration module.'),
'group' => t('Email registration'),
);
}
/**
* Implementation of setUp().
*/
function setUp() {
parent::setUp('email_registration');
// Configure to allow set password.
variable_set('user_email_verification', FALSE);
}
/**
* Test various behaviors for anonymous users.
*/
function testRegistration() {
// Try to register a user.
$name = $this->randomName();
$pass = $this->randomName(10);
$register = array(
'mail' => $name .'@example.com',
'pass[pass1]' => $pass,
'pass[pass2]' => $pass,
);
$this->drupalPost('/user/register', $register, t('Create new account'));
$login = array(
'name' => $name .'@example.com',
'pass' => $pass,
);
$this->drupalPost('user/login', $login, t('Log in'));
$this->assertRaw('<h2>'. $name .'</h2>', t('User properly created, logged in.'));
// $this->assertRaw('id="edit-name" size="60" value="'. $register['given_name'] .'"', t('Given name saved.'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment