Esempio n. 1
0
$repo = Utils::getQueryParam('repo');
$bugzilla = Utils::getQueryParam('bugzilla');
$tool = Utils::getQueryParam('tool');
$repos = new Repositories($source_path);
$json_data = new Json();
// Only one repo requested
if ($repo != '') {
    $locales = $repos->getSingleRepository($repo);
    if ($locales) {
        die($json_data->outputContent($locales));
    } else {
        http_response_code(400);
        die('ERROR: unknown repository.');
    }
}
// Only one type of repo requested
if ($type != '') {
    die($json_data->outputContent($repos->getTypeRepositories($type)));
}
// Bugzilla components
if ($bugzilla != '') {
    $bugzilla_query = new Bugzilla($source_path);
    die($json_data->outputContent($bugzilla_query->getBugzillaComponents($bugzilla)));
}
// Locales working in tools
if ($tool != '') {
    $tools_query = new Tools($source_path);
    die($json_data->outputContent($tools_query->getLocales($tool)));
}
// Display a list of all repositories
die($json_data->outputContent($repos->getRepositories()));
Esempio n. 2
0
 /**
  * @dataProvider getBugzillaComponentsDP
  */
 public function testGetBugzillaComponents($a, $b, $c)
 {
     $obj = new _Bugzilla(TEST_FILES);
     $this->string($obj->getBugzillaComponents($a)[$b])->isEqualTo($c);
 }