예제 #1
0
 public function test_create_method_creates_new_user_with_username_and_password()
 {
     $user = new User();
     $user->setUsername('brian');
     $user->setPassword('password');
     $created = User::create('brian', 'password');
     $this->assertEquals($user, $created);
 }
 public function hashPassword(User $user)
 {
     $hashed = $this->hasher->hash($user->getPassword());
     $user->setPassword($hashed);
 }
예제 #3
0
 public static function create($username, $password)
 {
     $user = new User();
     $user->setUsername($username);
     $user->setPassword($password);
     return $user;
 }
 public function setPassword($password)
 {
     $this->__load();
     return parent::setPassword($password);
 }