You are here

private function RestrictByIpRedirectTests::assertRedirected in Restrict Login or Role Access by IP Address 7.3

4 calls to RestrictByIpRedirectTests::assertRedirected()
RestrictByIpRedirectTests::testIpDifferGlobalNoDestination in ./restrict_by_ip.test
RestrictByIpRedirectTests::testIpDifferGlobalWithDestination in ./restrict_by_ip.test
RestrictByIpRedirectTests::testIpDifferUserNoDestination in ./restrict_by_ip.test
RestrictByIpRedirectTests::testIpDifferUserWithDestination in ./restrict_by_ip.test

File

./restrict_by_ip.test, line 297

Class

RestrictByIpRedirectTests
Test that user is redirected to error page when login denied. Assumes that local testing environment has IP address of 127.0.0.1.

Code

private function assertRedirected($destination = NULL) {
  $edit = array(
    'name' => $this->regularUser->name,
    'pass' => $this->regularUser->pass_raw,
  );
  $options = array();
  if (isset($destination)) {
    $options['query'] = array(
      'destination' => $destination,
    );
  }
  $this
    ->drupalPost('user', $edit, t('Log in'), $options);
  $this
    ->assertNoLink(t('Log out'), 0, t('User %name unsuccessfully logged in.', array(
    '%name' => $this->regularUser->name,
  )), t('User login'));
  $this
    ->assertText($this->loginDeniedNode->title, 'Title of login denied page found.');
}