function UserEditTestCase::testUserWith0Password

Tests setting the password to "0".

File

modules/user/user.test, line 2258

Class

UserEditTestCase
Tests editing a user account.

Code

public function testUserWith0Password() {
    $admin = $this->drupalCreateUser(array(
        'administer users',
    ));
    $this->drupalLogin($admin);
    // Create a regular user.
    $user1 = $this->drupalCreateUser(array());
    $edit = array(
        'pass[pass1]' => '0',
        'pass[pass2]' => '0',
    );
    $this->drupalPost("user/" . $user1->uid . "/edit", $edit, t('Save'));
    $this->assertRaw(t("The changes have been saved."));
    $this->drupalLogout();
    $user1->pass_raw = '0';
    $this->drupalLogin($user1);
    $this->drupalLogout();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.