public function _itCallsTheRealThing() { $r = new GitRepository(); $r->setName('dusse'); $r->setNamespace('jean_claude'); //$p = new Project(array('unix_group_name' => 'LesBronzes', 'group_id' => 50)); $p = stub('Project')->getUnixName()->returns('LesBronzes'); $r->setProject($p); $driver = new Git_Driver_Gerrit(new Git_Driver_Gerrit_RemoteSSHCommand(new BackendLogger()), new BackendLogger()); $driver->createProject($r); }
protected function _GivenAGitRepoWithNameAndNamespace($name, $namespace) { $repository = new GitRepository(); $repository->setName($name); $repository->setNamespace($namespace); $project = new MockProject(); $project->setReturnValue('getUnixName', 'gpig'); $project->setReturnValue('getId', 123); $repository->setProject($project); return $repository; }
/** * @deprecated Should use GitRepository::getInstanceFrom row instead. * @param GitRepository $repository * @param type $result */ public function hydrateRepositoryObject(GitRepository $repository, $result) { $repository->setName($result[self::REPOSITORY_NAME]); $repository->setPath($result[self::REPOSITORY_PATH]); $repository->setId($result[self::REPOSITORY_ID]); $repository->setDescription($result[self::REPOSITORY_DESCRIPTION]); $repository->setParentId($result[self::REPOSITORY_PARENT]); $project = ProjectManager::instance()->getProject($result[self::FK_PROJECT_ID]); $repository->setProject($project); $repository->setCreationDate($result[self::REPOSITORY_CREATION_DATE]); $user = UserManager::instance()->getUserById($result[self::REPOSITORY_CREATION_USER_ID]); $repository->setCreator($user); $repository->setIsInitialized($result[self::REPOSITORY_IS_INITIALIZED]); $repository->setDeletionDate($result[self::REPOSITORY_DELETION_DATE]); $repository->setAccess($result[self::REPOSITORY_ACCESS]); $repository->setMailPrefix($result[self::REPOSITORY_MAIL_PREFIX]); $repository->setBackendType($result[self::REPOSITORY_BACKEND_TYPE]); $repository->setNamespace($result[self::REPOSITORY_NAMESPACE]); $repository->setBackupPath($result[self::REPOSITORY_BACKUP_PATH]); $repository->setScope($result[self::REPOSITORY_SCOPE]); $repository->setRemoteServerId($result[self::REMOTE_SERVER_ID]); $repository->setRemoteServerDisconnectDate($result[self::REMOTE_SERVER_DISCONNECT_DATE]); $repository->setRemoteProjectDeletionDate($result[self::REMOTE_SERVER_DELETE_DATE]); $repository->setRemoteServerMigrationStatus($result[self::REMOTE_SERVER_MIGRATION_STATUS]); $repository->loadNotifiedMails(); /* Here just for reviewer test, will be replaced by real DB data in a future changeset*/ $result[self::ENABLE_ONLINE_EDIT] = false; if ($result[self::ENABLE_ONLINE_EDIT] && GitConfig::instance()->isOnlineEditEnabled()) { $repository->enableOnlineEdit(); } }
protected function buildRepositoryFromRow($row, $project, $notification_manager = null) { $repository_id = $row[GitDao::REPOSITORY_ID]; $repository = new GitRepository(); $repository->setId($repository_id); $repository->setName($row[GitDao::REPOSITORY_NAME]); $repository->setProject($project); if (!$notification_manager) { $notification_manager = $this->getPostReceiveMailManager(); } $notified_mails = $notification_manager->getNotificationMailsByRepositoryId($repository_id); $repository->setNotifiedMails($notified_mails); $repository->setMailPrefix($row[GitDao::REPOSITORY_MAIL_PREFIX]); $repository->setNamespace($row[GitDao::REPOSITORY_NAMESPACE]); return $repository; }
private function _GivenARepositoryWithNameAndNamespace($name, $namespace) { $repo = new GitRepository(); $repo->setName($name); $repo->setNamespace($namespace); return $repo; }
public function hydrateRepositoryObject(GitRepository $repository, $result) { $repository->setName($result[self::REPOSITORY_NAME]); $repository->setPath($result[self::REPOSITORY_PATH]); $repository->setId($result[self::REPOSITORY_ID]); $repository->setDescription($result[self::REPOSITORY_DESCRIPTION]); $repository->setParentId($result[self::REPOSITORY_PARENT]); $project = ProjectManager::instance()->getProject($result[self::FK_PROJECT_ID]); $repository->setProject($project); $repository->setCreationDate($result[self::REPOSITORY_CREATION_DATE]); $user = UserManager::instance()->getUserById($result[self::REPOSITORY_CREATION_USER_ID]); $repository->setCreator($user); $repository->setIsInitialized($result[self::REPOSITORY_IS_INITIALIZED]); $repository->setDeletionDate($result[self::REPOSITORY_DELETION_DATE]); $repository->setAccess($result[self::REPOSITORY_ACCESS]); $repository->setMailPrefix($result[self::REPOSITORY_MAIL_PREFIX]); $repository->setBackendType($result[self::REPOSITORY_BACKEND_TYPE]); $repository->setNamespace($result[self::REPOSITORY_NAMESPACE]); $repository->setScope($result[self::REPOSITORY_SCOPE]); $repository->loadNotifiedMails(); }