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