mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Merge branch 'MDL-64701-category-customfields-master' of https://github.com/dmitriim/moodle
This commit is contained in:
commit
8de5c25696
@ -181,4 +181,16 @@ class customfield extends \core_search\base {
|
||||
public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon {
|
||||
return new \core_search\document_icon('i/customfield');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of category names associated with the area.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_category_names() {
|
||||
return [
|
||||
\core_search\manager::SEARCH_AREA_CATEGORY_COURSE_CONTENT,
|
||||
\core_search\manager::SEARCH_AREA_CATEGORY_COURSES
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -609,8 +609,10 @@ class course_search_testcase extends advanced_testcase {
|
||||
public function test_get_category_names() {
|
||||
$coursessearcharea = \core_search\manager::get_search_area($this->coursesareaid);
|
||||
$sectionsearcharea = \core_search\manager::get_search_area($this->sectionareaid);
|
||||
$customfieldssearcharea = \core_search\manager::get_search_area($this->customfieldareaid);
|
||||
|
||||
$this->assertEquals(['core-courses'], $coursessearcharea->get_category_names());
|
||||
$this->assertEquals(['core-course-content'], $sectionsearcharea->get_category_names());
|
||||
$this->assertEquals(['core-course-content', 'core-courses'], $customfieldssearcharea->get_category_names());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user