public function setPassword($password) { $salt = $this->generateRandomString(); $this->password = implode(self::HASH_SEP, array(self::HASH_ALGO, $salt, hash(self::HASH_ALGO, $salt . $password))); return $this; }
public function setUp() { parent::setUp('Newscoop\\Entity\\User', 'Newscoop\\Entity\\Acl\\Role'); $this->service = new DoctrineAuthService($this->em); $this->user = new User(); $this->user->setEmail(self::EMAIL); $this->user->setUsername(self::USERNAME); $this->user->setPassword(self::PASSWORD); $this->em->persist($this->user); $this->em->flush(); }