mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-15666 - fixing bugs in resource unit test implementation
This commit is contained in:
parent
b2a9505b22
commit
c50466705e
@ -98,7 +98,7 @@ $string['parameter'] = 'Parameter';
|
||||
$string['parameters'] = 'Parameters';
|
||||
$string['popupresource'] = 'This resource should appear in a popup window.';
|
||||
$string['popupresourcelink'] = 'If it didn\'t, click here: $a';
|
||||
$string['portfolionotimplemented'] = 'You are trying to export content from a resource type that doesn\'t support it!';
|
||||
$string['portfolionotimplemented'] = 'You are trying to export content from a resource type ($a) that doesn\'t support it!';
|
||||
$string['preview'] = 'Preview';
|
||||
$string['previous'] = 'Previous';
|
||||
$string['redeploy'] = 'Deploy again';
|
||||
|
@ -727,6 +727,9 @@ class resource_portfolio_caller extends portfolio_module_caller_base {
|
||||
$this->resourcefile = $CFG->dirroot.'/mod/resource/type/'.$this->cm->type.'/resource.class.php';
|
||||
require_once($this->resourcefile);
|
||||
$this->resource= new $resourceclass($this->cm->id);
|
||||
if (!is_callable(array($resource, 'portfolio_prepare_package')) || !is_callable(array($resource, 'portfolio_get_sha1'))) {
|
||||
throw new portfolio_exception('portfolionotimplemented', 'resource', null, $this->cm->type);
|
||||
}
|
||||
$this->supportedformats = array(self::type_to_format($this->cm->type));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ class testResourcePortfolioCallers extends portfoliolib_test {
|
||||
$first_module = reset($this->modules);
|
||||
$cm = get_coursemodule_from_instance($this->module_type, $first_module->id);
|
||||
|
||||
$this->caller = parent::setup_caller('resource_portfolio_caller', array('id' => $cm->id));
|
||||
$this->caller = parent::setup_caller('resource_portfolio_caller', array('id' => $cm->instance));
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user