public function testActivate()
 {
     $apiUser = new ApiUser('username', 'password');
     $hash = $apiUser->getHash();
     $apiUser->activate($hash);
     $this->assertTrue($apiUser->isActive());
 }
 public function load(ObjectManager $manager)
 {
     for ($i = 1; $i <= 10; $i++) {
         $email = sprintf("*****@*****.**", $i);
         $user = new DiamanteUser($email, 'Test', 'User');
         $apiUser = new ApiUser($email, UserServiceImpl::generateRandomSequence(20), UserServiceImpl::generateRandomSequence(20));
         $apiUser->activate($apiUser->getHash());
         $user->setApiUser($apiUser);
         $user->setDeleted(false);
         $manager->persist($user);
     }
     $manager->flush();
 }