本文整理汇总了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);
}