public function RestrictByIpUITests::testUserRegisterSubmit in Restrict Login or Role Access by IP Address 7.3
File
- ./
restrict_by_ip.test, line 354
Class
- RestrictByIpUITests
- Test admin interfaces. Assumes that local testing environment has IP address of 127.0.0.1.
Code
public function testUserRegisterSubmit() {
$form = array();
$form['name'] = $this
->randomName(8);
$form['mail'] = $this
->randomName(5) . '@domain.notatld';
$pass = $this
->randomName(5);
$form['pass[pass1]'] = $pass;
$form['pass[pass2]'] = $pass;
$form['restrict_by_ip_address'] = '127.0.0.1/32';
$this
->drupalPost('admin/people/create', $form, t('Create new account'));
$user = user_load_by_name($form['name']);
$this
->assertText(t('Created a new user account for @name. No e-mail has been sent.', array(
'@name' => $form['name'],
)));
$this
->drupalGet('user/' . $user->uid . '/edit');
$this
->assertFieldByName('restrict_by_ip_address', $form['restrict_by_ip_address']);
}