当前位置: 首页>>代码示例>>PHP>>正文


PHP PFUser::setId方法代码示例

本文整理汇总了PHP中PFUser::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::setId方法的具体用法?PHP PFUser::setId怎么用?PHP PFUser::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PFUser的用法示例。


在下文中一共展示了PFUser::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testExecutes_ForkRepositories_ActionWithAListOfRepos

 public function testExecutes_ForkRepositories_ActionWithAListOfRepos()
 {
     $groupId = 101;
     $repo = new GitRepository();
     $repos = array($repo);
     $user = new PFUser();
     $user->setId(42);
     $user->setUserName('Ben');
     $path = userRepoPath('Ben', 'toto');
     $forkPermissions = array();
     $project = new MockProject();
     $projectManager = new MockProjectManager();
     $projectManager->setReturnValue('getProject', $project, array($groupId));
     $factory = new MockGitRepositoryFactory();
     $factory->setReturnValue('getRepositoryById', $repo);
     $git = TestHelper::getPartialMock('Git', array('definePermittedActions', '_informAboutPendingEvents', 'addAction', 'addView', 'checkSynchronizerToken'));
     $git->setGroupId($groupId);
     $git->setProjectManager($projectManager);
     $git->expectAt(0, 'addAction', array('getProjectRepositoryList', array($groupId)));
     $git->expectAt(1, 'addAction', array('fork', array($repos, $project, $path, GitRepository::REPO_SCOPE_INDIVIDUAL, $user, $GLOBALS['HTML'], '/plugins/git/?group_id=101&user=42', $forkPermissions)));
     $request = new Codendi_Request(array('repos' => '1001', 'path' => 'toto', 'repo_access' => $forkPermissions));
     $git->setFactory($factory);
     $git->_doDispatchForkRepositories($request, $user);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:24,代码来源:Git_ForkRepositories_Test.php

示例2: createAccount

 /**
  * Create new account
  *
  * @param PFUser $user
  *
  * @return PFUser
  */
 function createAccount($user)
 {
     $dao = $this->getDao();
     $user_id = $dao->create($user->getUserName(), $user->getEmail(), $user->getPassword(), $user->getRealName(), $user->getRegisterPurpose(), $user->getStatus(), $user->getShell(), $user->getUnixStatus(), $user->getUnixUid(), $user->getUnixBox(), $user->getLdapId(), $_SERVER['REQUEST_TIME'], $user->getConfirmHash(), $user->getMailSiteUpdates(), $user->getMailVA(), $user->getStickyLogin(), $user->getAuthorizedKeys(), $user->getNewMail(), $user->getTimeZone(), $user->getTheme(), $user->getLanguageID(), $user->getExpiryDate(), $_SERVER['REQUEST_TIME']);
     if (!$user_id) {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_exit', 'error'));
         return 0;
     } else {
         $user->setId($user_id);
         $this->assignNextUnixUid($user);
         $em = $this->_getEventManager();
         $em->processEvent(Event::USER_MANAGER_CREATE_ACCOUNT, array('user' => $user));
         // Create the first layout for the user and add some initial widgets
         $lm = $this->_getWidgetLayoutManager();
         $lm->createDefaultLayoutForUser($user_id);
         switch ($user->getStatus()) {
             case PFUser::STATUS_PENDING:
                 if (ForgeConfig::get('sys_user_approval')) {
                     $this->pending_user_notifier->notifyAdministrator($user);
                 }
                 break;
             case PFUser::STATUS_ACTIVE:
             case PFUser::STATUS_RESTRICTED:
                 $em->processEvent('project_admin_activate_user', array('user_id' => $user_id));
                 break;
         }
         return $user;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:UserManager.class.php

示例3: testUserRepositoryDoesNotBelongToAnotherUser

 public function testUserRepositoryDoesNotBelongToAnotherUser()
 {
     $creator = new PFUser(array('language_id' => 1));
     $creator->setId(123);
     $user = new PFUser(array('language_id' => 1));
     $user->setId(456);
     $repo = new GitRepository();
     $repo->setCreator($creator);
     $repo->setScope(GitRepository::REPO_SCOPE_INDIVIDUAL);
     $this->assertFalse($repo->belongsTo($user));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:GitRepositoryTest.php


注:本文中的PFUser::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。