MDL-42666 tests: Setting new Box.net mandatory arguments

This commit is contained in:
Frederic Massart 2013-11-07 13:32:09 +08:00
parent 81b07e655c
commit 7cb353ff69
2 changed files with 6 additions and 3 deletions

View File

@ -177,7 +177,7 @@ class testing_repository_generator extends component_generator_base {
$record = $this->prepare_type_record($record);
foreach ($typeoptions as $option) {
if (!isset($record[$option])) {
throw new coding_exception("$option must be present in testing::create_repository_type() $record");
throw new coding_exception("$option must be present in testing::create_repository_type() for $type");
}
}

View File

@ -41,8 +41,11 @@ class repository_boxnet_generator extends testing_repository_generator {
*/
protected function prepare_type_record(array $record) {
$record = parent::prepare_type_record($record);
if (!isset($record['api_key'])) {
$record['api_key'] = 'api_key';
if (!isset($record['clientid'])) {
$record['clientid'] = 'clientid';
}
if (!isset($record['clientsecret'])) {
$record['clientsecret'] = 'clientsecret';
}
return $record;
}