See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
Solr earch engine base unit tests. Required params: - define('TEST_SEARCH_SOLR_HOSTNAME', '127.0.0.1'); - define('TEST_SEARCH_SOLR_PORT', '8983'); - define('TEST_SEARCH_SOLR_INDEXNAME', 'unittest');
Copyright: | 2015 David Monllao {@link http://www.davidmonllao.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1322 lines (56 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
search_solr_engine_testcase:: (30 methods):
setUp()
tearDown()
file_indexing_provider()
test_connection()
test_index()
test_search()
test_delete()
test_alloweduserid()
test_highlight()
test_export_file_for_engine()
test_index_file()
test_reindexing_files()
test_index_filtered_file()
test_delete_by_id()
test_solr_filling()
setup_user_hidden_docs()
test_get_query_total_count()
test_manager_paged_search()
test_context_restriction()
test_groups()
test_user_restriction()
test_italics()
assert_result_titles()
test_get_supported_orders_relevance_only()
test_get_supported_orders_relevance_and_location()
test_ordering()
test_bogus_content()
create_search_record()
test_deleted_contexts_and_courses()
assert_raw_solr_query_result()
Class: search_solr_engine_testcase - X-Ref
Solr search engine base unit tests.setUp() X-Ref |
tearDown() X-Ref |
No description |
file_indexing_provider() X-Ref |
Simple data provider to allow tests to be run with file indexing on and off. |
test_connection() X-Ref |
No description |
test_index($fileindexing) X-Ref |
test_search($fileindexing) X-Ref |
Better keep this not very strict about which or how many results are returned as may depend on solr engine config. return: void |
test_delete($fileindexing) X-Ref |
test_alloweduserid($fileindexing) X-Ref |
test_highlight($fileindexing) X-Ref |
test_export_file_for_engine() X-Ref |
No description |
test_index_file() X-Ref |
No description |
test_reindexing_files() X-Ref |
No description |
test_index_filtered_file() X-Ref |
Test indexing a file we don't consider indexable. |
test_delete_by_id() X-Ref |
No description |
test_solr_filling($fileindexing) X-Ref |
Test that expected results are returned, even with low check_access success rate. |
setup_user_hidden_docs($user) X-Ref |
Create 40 docs, that will be return from Solr in 10 hidden, 10 visible, 10 hidden, 10 visible if you query for: Something1 Something2 Something3 Something4, with the specified user set. |
test_get_query_total_count($fileindexing) X-Ref |
Test that counts are what we expect. |
test_manager_paged_search($fileindexing) X-Ref |
Test that paged results are what we expect. |
test_context_restriction() X-Ref |
Tests searching for results restricted to context id. |
test_groups() X-Ref |
Tests searching for results in groups, either by specified group ids or based on user access permissions. |
test_user_restriction() X-Ref |
Tests searching for results restricted to specific user id(s). |
test_italics() X-Ref |
Tests searching for results containing words in italic text. (This used to fail.) |
assert_result_titles(array $expected, array $results) X-Ref |
Asserts that the returned documents have the expected titles (regardless of order). param: string[] $expected List of expected document titles param: \core_search\document[] $results List of returned documents |
test_get_supported_orders_relevance_only() X-Ref |
Tests the get_supported_orders function for contexts where we can only use relevance (system, category). |
test_get_supported_orders_relevance_and_location() X-Ref |
Tests the get_supported_orders function for contexts where we support location as well (course, activity, block). |
test_ordering() X-Ref |
Tests ordering by relevance vs location. |
test_bogus_content() X-Ref |
Tests with bogus content (that can be entered into Moodle) to see if it crashes. |
create_search_record($courseid, $contextid, $title, $content) X-Ref |
Adds a record to the mock search area, so that the search engine can find it later. param: int $courseid Course id param: int $contextid Context id param: string $title Title for search index param: string $content Content for search index |
test_deleted_contexts_and_courses() X-Ref |
Tries out deleting data for a context or a course. |
assert_raw_solr_query_result(string $q, array $expected) X-Ref |
Carries out a raw Solr query using the Solr basic query syntax. This is used to test data contained in the index without going through Moodle processing. param: string $q Search query param: string[] $expected Expected titles of results, in alphabetical order |