public setPassword ( string $password ) : void | ||
$password | string | The password to be hashed |
리턴 | void |
public function setPassword($password)
{
$this->attributes['password_hash'] = _elgg_services()->passwords->generateHash($password);
}
/** * Called before each test object. */ public function __construct() { parent::__construct(); $this->user = new \ElggUser(); $this->user->username = '******' . rand(); $this->user->email = '*****@*****.**' . rand(); $this->user->name = 'fake user ' . rand(); $this->user->access_id = ACCESS_PUBLIC; $this->user->setPassword(rand()); $this->user->owner_guid = 0; $this->user->container_guid = 0; $this->user->save(); }