示例#1
0
 public function testSetPassword()
 {
     $role = new core_kernel_classes_Resource(INSTANCE_ROLE_GENERIS);
     $user = $this->service->addUser('passwordUser', 'passwordUser', $role);
     $this->assertTrue($user->exists());
     $this->assertTrue($this->service->isPasswordValid('passwordUser', $user));
     $this->assertFalse($this->service->isPasswordValid('password', $user));
     $this->service->setPassword($user, 'password');
     $this->assertTrue($this->service->isPasswordValid('password', $user));
     $this->service->removeUser($user);
     $this->assertFalse($user->exists());
 }
 /**
  * Change the password of a given user.
  * 
  * @param core_kernel_classes_Resource user The user you want to change the password.
  * @param string password The md5 hash of the new password.
  */
 public function setPassword(core_kernel_classes_Resource $user, $password)
 {
     return $this->generisUserService->setPassword($user, $password);
 }