Beispiel #1
0
/**
 * Determines whether the current plugin supports the supplied feature
 *
 * @param string $feature A feature description, either in the form
 *                        [entity] or [entity]_[action]
 *
 * @return mixed An array of actions for a supplied entity, an array of
 *               required fields for a supplied action, or false on error
 */
function dhimport_header_supports($feature)
{
    global $CFG;
    require_once dirname(__FILE__) . '/header.class.php';
    $data_plugin = new rlip_importplugin_header();
    //delegate to class method
    return $data_plugin->plugin_supports($feature);
}
Beispiel #2
0
 /**
  * Validates that the import process calls the "header read" hook
  */
 public function test_importtriggersheaderreadhook()
 {
     global $CFG;
     $file = get_plugin_directory('dhimport', 'header') . '/header.class.php';
     require_once $file;
     $provider = new rlip_importprovider_mock();
     $importplugin = new rlip_importplugin_header($provider);
     $importplugin->run();
     $this->assertEquals($importplugin->hook_called(), true);
 }