Пример #1
0
 public function testDoesnMessUpGlobalState()
 {
     $factory = new BaseLanguageFactory();
     $currentlocale = setlocale(LC_ALL, '0');
     $fr = $factory->getBaseLanguage('fr_FR');
     $this->assertEqual($currentlocale, setlocale(LC_ALL, '0'));
     $us = $factory->getBaseLanguage('en_US');
     $this->assertEqual($currentlocale, setlocale(LC_ALL, '0'));
 }
 private function sendErrorNotification(GitRepository $repository)
 {
     $user = $this->getRequester();
     if (!$user->isAnonymous()) {
         $factory = new BaseLanguageFactory();
         $language = $factory->getBaseLanguage($user->getLocale());
         $url = get_server_url() . GIT_BASE_URL . '/?action=repo_management&group_id=' . $repository->getProjectId() . '&repo_id=' . $repository->getId() . '&pane=gerrit';
         $notification = new Notification(array($user->getEmail()), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_subject', array($repository->getFullName())), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $url, 'git');
         $this->mail_builder->buildAndSendEmail($repository->getProject(), $notification, new MailEnhancer());
     }
 }