Пример #1
0
 public static function create($serviceLocator, $documentManager)
 {
     //craete temp auth user
     $sysUser = new User();
     $sysUser->addRole('admin');
     $serviceLocator->setService('user', $sysUser);
     $user = new User();
     $user->setUsername('toby');
     $user->setFirstName('Toby');
     $user->setLastName('McQueen');
     $user->setEmail('*****@*****.**');
     $user->setPassword('password1');
     $user->setSalt('passwordpasswordpasswordpasswordpassword');
     $documentManager->persist($user);
     $documentManager->flush();
     $sysUser->removeRole('admin');
     $documentManager->clear();
 }
Пример #2
0
 public static function create($serviceLocator, $documentManager)
 {
     //Create data in the db to query against
     $documentManager->getConnection()->selectDatabase('gomi-test');
     //craete temp auth user
     $sysUser = new User();
     $sysUser->addRole('admin');
     $serviceLocator->setService('user', $sysUser);
     $user = new User();
     $user->setUsername('toby');
     $user->setFirstName('Toby');
     $user->setLastName('Awesome');
     $user->setPassword('password1');
     $user->setEmail('*****@*****.**');
     $documentManager->persist($user);
     $documentManager->flush();
     $documentManager->clear();
 }