예제 #1
0
 public function itThrowsAnExceptionIfGerritPushFails()
 {
     expect($this->gerrit_user_account_manager)->pushSSHKeys()->once();
     $this->gerrit_user_account_manager->throwOn('pushSSHKeys', new Git_UserSynchronisationException());
     $this->expectException('Git_UserSynchronisationException');
     $this->user_account_manager->pushSSHKeys($this->user);
 }
예제 #2
0
 private function getAccessURLs()
 {
     $urls = $this->repository->getAccessURL();
     if ($this->repository->isMigratedToGerrit()) {
         $gerrit_user = $this->gerrit_usermanager->getGerritUser($this->current_user);
         $gerrit_server = $this->gerrit_servers[$this->repository->getRemoteServerId()];
         $driver = $this->driver_factory->getDriver($gerrit_server);
         $gerrit_project = $driver->getGerritProjectName($this->repository);
         $clone_url = $gerrit_server->getEndUserCloneUrl($gerrit_project, $gerrit_user);
         $this->prependGerritCloneURL($urls, $clone_url);
     }
     return $urls;
 }
예제 #3
0
 public function itCreatesGerritUserFromLdapUser()
 {
     $user_manager = new Git_Driver_Gerrit_UserAccountManager(mock('Git_Driver_Gerrit_GerritDriverFactory'), mock('Git_RemoteServer_GerritServerFactory'));
     $gerrit_user = $user_manager->getGerritUser(mock('PFUser'));
     $this->assertEqual($gerrit_user->getWebUserName(), $this->ldap_login);
 }