Example #1
0
 /**
  * Check that a locale is available for a repository
  *
  * @param  string  $locale     Locale code we want to check
  * @param  string  $repository Repository name we want to check the locale for
  * @return boolean True if we support the locale, False if we don't
  */
 private function verifyLocaleExists($locale, $repository)
 {
     if ($repository == 'global') {
         $locale_repositories = Project::getLocaleRepositories($locale);
         if (!empty($locale_repositories)) {
             return true;
         }
     }
     if (!in_array($locale, Project::getRepositoryLocales($repository))) {
         $this->log("The locale queried ({$locale}) is not " . "available for the repository ({$repository}).");
         return false;
     }
     return true;
 }
Example #2
0
 /**
  * @dataProvider getLocaleRepositoriesDP
  */
 public function testGetLocaleRepositories($a, $b)
 {
     $obj = new _Project();
     $this->array($obj->getLocaleRepositories($a))->isEqualTo($b);
 }