You are here

public function DomainRegistrationTest::testDenyCustomMessage in Restrict Domain Registration 7

File

./domain_registration.test, line 104
Tests for the Domain Registration Module

Class

DomainRegistrationTest
@file Tests for the Domain Registration Module

Code

public function testDenyCustomMessage() {
  variable_set('domain_registration', 'example.com');
  variable_set('domain_registration_method', DOMAIN_REGISTRATION_DENY);
  variable_set('domain_registration_message', 'foo bar baz');

  // Get the user data for registration.
  $edit = array(
    'name' => $this
      ->randomName(),
    'mail' => $this
      ->randomName() . '@example.com',
  );

  // Attempt to register a user with a blacklist email.
  $this
    ->drupalPost('user/register', $edit, t('Create new account'));
  $this
    ->assertText(t('foo bar baz'), t('Custom denial message was shown.'));
}