See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 401]
Core search class adapted to unit test.
Copyright: | 2015 David Monllao {@link http://www.davidmonllao.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 135 lines (4 kb) |
Included or required: | 6 times |
Referenced: | 15 times |
Includes or requires: | 1 file search/tests/fixtures/mock_search_engine.php |
testable_core_search:: (7 methods):
instance()
get_areas_user_accesses()
add_search_area()
add_core_search_areas()
is_search_area()
fake_current_time()
build_limitcourseids()
Class: testable_core_search - X-Ref
Core search class adapted to unit test.instance($searchengine = false, bool $ignored = false) X-Ref |
Attaches the mock engine to search. Auto enables global search. param: \core_search\engine|bool $searchengine param: bool $ignored Second param just to make this compatible with base class return: testable_core_search |
get_areas_user_accesses($limitcourseids = false, $limitcontextids = false) X-Ref |
Changes visibility. return: array |
add_search_area($areaid, \core_search\base $searcharea) X-Ref |
Adds an enabled search component to the search areas list. param: string $areaid param: \core_search\base $searcharea return: void |
add_core_search_areas() X-Ref |
Loads all core search areas. return: void |
is_search_area($classname) X-Ref |
Changes visibility. param: string $classname return: bool |
fake_current_time($faketime = 0.0) X-Ref |
Fakes the current time for PHPunit. Turns off faking time if called with default parameter. Note: This should be replaced with core functionality once possible (see MDL-60644). param: float $faketime Current time |
build_limitcourseids(\stdClass $formdata) X-Ref |
Makes build_limitcourseids method public for testing. param: \stdClass $formdata Submitted search form data. return: array|bool |