public function generateAndSaveActivationLink($user)
 {
     $activationKey = $this->generatePassword(50);
     $activationToken = new \Application\Model\UserActivationTokenModel();
     $activationToken->setUserId($user->getId());
     $activationToken->setToken($activationKey);
     UserMapper::getInstance()->insertActivationToken($activationToken);
     return $activationKey;
 }
 public function testFindActivationTokenByUserId()
 {
     $link = new \Application\Model\UserActivationTokenModel();
     $link->setUserId($this->_userId);
     $link->setToken('token23984u2093');
     $this->userMapper->insertActivationToken($link);
     $link = $this->userMapper->findActivationToken($link->getUserId(), $link->getToken());
     $this->assertNotNull($link);
     $this->assertNotNull($link->getUserId());
 }