本文整理匯總了PHP中core_plugin_manager::standard_plugins_list方法的典型用法代碼示例。如果您正苦於以下問題:PHP core_plugin_manager::standard_plugins_list方法的具體用法?PHP core_plugin_manager::standard_plugins_list怎麽用?PHP core_plugin_manager::standard_plugins_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core_plugin_manager
的用法示例。
在下文中一共展示了core_plugin_manager::standard_plugins_list方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_get_plugins_file_areas
/**
* Test get plugins file areas
*/
public function test_get_plugins_file_areas()
{
$this->setUser($this->editingteachers[0]);
$assign = $this->create_instance();
// Test that all the submission and feedback plugins are returning the expected file aras.
$usingfilearea = 0;
$coreplugins = core_plugin_manager::standard_plugins_list('assignsubmission');
foreach ($assign->get_submission_plugins() as $plugin) {
$type = $plugin->get_type();
if (!in_array($type, $coreplugins)) {
continue;
}
$fileareas = $plugin->get_file_areas();
if ($type == 'onlinetext') {
$this->assertEquals(array('submissions_onlinetext' => 'Online text'), $fileareas);
$usingfilearea++;
} else {
if ($type == 'file') {
$this->assertEquals(array('submission_files' => 'File submissions'), $fileareas);
$usingfilearea++;
} else {
$this->assertEmpty($fileareas);
}
}
}
$this->assertEquals(2, $usingfilearea);
$usingfilearea = 0;
$coreplugins = core_plugin_manager::standard_plugins_list('assignfeedback');
foreach ($assign->get_feedback_plugins() as $plugin) {
$type = $plugin->get_type();
if (!in_array($type, $coreplugins)) {
continue;
}
$fileareas = $plugin->get_file_areas();
if ($type == 'editpdf') {
$this->assertEquals(array('download' => 'Annotate PDF'), $fileareas);
$usingfilearea++;
} else {
if ($type == 'file') {
$this->assertEquals(array('feedback_files' => 'Feedback files'), $fileareas);
$usingfilearea++;
} else {
$this->assertEmpty($fileareas);
}
}
}
$this->assertEquals(2, $usingfilearea);
}