public function RestrictByIpUITests::testUserEditValidation in Restrict Login or Role Access by IP Address 7.3
File
- ./
restrict_by_ip.test, line 372
Class
- RestrictByIpUITests
- Test admin interfaces. Assumes that local testing environment has IP address of 127.0.0.1.
Code
public function testUserEditValidation() {
$user = $this
->drupalCreateUser();
$this
->drupalGet('user/' . $user->uid . '/edit');
$this
->assertFieldByName('restrict_by_ip_address', '');
$form = array();
$form['restrict_by_ip_address'] = 'not_an_ip';
$this
->drupalPost('user/' . $user->uid . '/edit', $form, t('Save'));
$this
->assertText('IP Address in Incorrect Format.');
$this
->assertNoText('The changes have been saved.');
}