function UserUpgradePathPasswordTokenTestCase::testUserUpgrade

Test a successful upgrade.

File

modules/simpletest/tests/upgrade/upgrade.user.test, line 26

Class

UserUpgradePathPasswordTokenTestCase
Upgrade test for user.module (password token involved).

Code

public function testUserUpgrade() {
    if ($this->skipUpgradeTest) {
        return;
    }
    $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
    $this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), ', [user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token involved).');
    // Check that a non-md5 hash was untouched.
    $pass = db_query('SELECT pass FROM {users} WHERE uid = 3')->fetchField();
    $this->assertEqual('$S$DAK00p3Dkojkf4O/UizYxenguXnjv', $pass, 'Pre-existing non-MD5 password hash was not altered');
}

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