function LegalRegisterTestCase::testRegisterUnsuccessful in Legal 7
Same name and namespace in other branches
- 6.8 legal.test \LegalRegisterTestCase::testRegisterUnsuccessful()
- 7.2 legal.test \LegalRegisterTestCase::testRegisterUnsuccessful()
Don't accept T&C no account created.
File
- ./
legal.test, line 87 - 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');
}