Example #1
0
 /**
  * @param User $user
  * @param $password
  * @return User
  */
 public function changePassword(User $user, $password)
 {
     $bcrypt = new Bcrypt();
     $bcrypt->setCost(14);
     $encryptedPassword = $bcrypt->create($password);
     $user->setPassword($encryptedPassword);
     $this->saveUser($user);
     return $user;
 }
Example #2
0
 public function testGetSetPassword()
 {
     $this->user->setPassword('[123456]');
     $this->assertEquals('[123456]', $this->user->getPassword());
 }