/** * 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_sample_supports($feature) { global $CFG; require_once dirname(__FILE__) . '/sample.class.php'; $data_plugin = new rlip_importplugin_sample(); //delegate to class method return $data_plugin->plugin_supports($feature); }
/** * Validate that the process_import_file method returns false when and * import file is missing */ public function test_processimportfilereturnsfalseformissingfile() { $provider = new rlip_importprovider_nodata(); $importplugin = new rlip_importplugin_sample($provider); $importplugin->run(); $result = $importplugin->process_import_file('bogusentity', 0, null); // Method should return false instead of null, types are important. $this->assertSame(false, $result); }