You are here

public function SecureSiteFunctionUserSaveUnitTest::testSecureSiteFunctionUserSaveUpdatePassChanged in Secure Site 7.2

Same name and namespace in other branches
  1. 6.2 securesite.test \SecureSiteFunctionUserSaveUnitTest::testSecureSiteFunctionUserSaveUpdatePassChanged()

Update user name and password.

File

./securesite.test, line 428
Tests for Secure Site module.

Class

SecureSiteFunctionUserSaveUnitTest
Unit tests for user_save().

Code

public function testSecureSiteFunctionUserSaveUpdatePassChanged() {
  $user = user_save($this->user, array(
    'name' => $this
      ->randomName(),
    'pass' => user_password(),
  ));
  $old = exec("{$this->stored_passwords} {$this->name_arg} {$this->pass_arg} {$this->realm_arg}");
  $new = exec("{$this->stored_passwords} username=" . escapeshellarg($user->name) . " {$this->pass_arg} {$this->realm_arg}");
  $this
    ->assertTrue($old == $this->user->name . " not found in {$this->realm}." && $new == "Updated {$user->name} in {$this->realm}.", t('Updating user name and password.'));
}