public function testGetRepositories() { $obj = new _Repositories(TEST_FILES); $result = [['id' => 'beta', 'display_order' => 1, 'name' => 'Beta', 'locales' => ['da', 'de', 'dsb', 'el'], 'type' => 'product']]; $this->array($obj->getRepositories())->isEqualTo($result); }
$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()));