Example #1
0
 public function testSetPasswordHashesPasswords()
 {
     $user = new User();
     $pw = 'supersecretpw';
     $user->setPassword($pw);
     $this->assertNotEquals($user->getPassword(), $pw);
     $this->assertTrue(password_verify($pw, $user->getPassword()));
 }
Example #2
0
 private function setSessionUser(User $user)
 {
     $_SESSION[self::$name] = $user->getName();
     $_SESSION[self::$userAgent] = $_SERVER['HTTP_USER_AGENT'];
 }