1 user.test UserLoginTestCase::testArrayLoginValues()

Attempt to login with an invalid array users and passwords.

File

core/modules/user/tests/user.test, line 598
Tests for user.module.

Class

UserLoginTestCase
Functional tests for user logins, including rate limiting of login attempts.

Code

function testArrayLoginValues() {
  $edit = array(
    'pass' => $this->randomName(8),
  );
  $extra_post = '&' . http_build_query(array(
    'name[0]' => $this->randomName(8),
    'name[1]' => $this->randomName(8),
  ));
  $this->backdropPost('user', $edit, t('Log in'), array(), array(), NULL, $extra_post);
  $this->assertText(t('Sorry, unrecognized username.'));

  $account = $this->backdropCreateUser(array());
  $edit = array(
    'name' => $account->name,
  );
  $extra_post = '&' . http_build_query(array(
    'pass[0]' => $this->randomName(8),
    'pass[1]' => $this->randomName(8),
  ));
  $this->backdropPost('user', $edit, t('Log in'), array(), array(), NULL, $extra_post);
  $this->assertText(t('Sorry, incorrect password.'));
}