Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]
(no description)
File Size: | 1495 lines (63 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
engine_test:: (34 methods):
setUp()
tearDown()
file_indexing_provider()
test_connection()
test_alternate_settings()
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()
test_add_document_batch()
test_batching()
test_add_document_batch_large()
assert_raw_solr_query_result()
Class: engine_test - 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_alternate_settings() X-Ref |
Tests that the alternate settings are used when configured. |
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. |
test_add_document_batch() X-Ref |
Specific test of the add_document_batch function (also used in many other tests). |
test_batching() X-Ref |
Tests the batching logic, specifically the limit to 100 documents per batch, and not batching very large documents. |
test_add_document_batch_large() X-Ref |
Tests with large documents. The point of this test is that we stop batching documents if they are bigger than 1MB, and the maximum batch count is 100, so the maximum size batch will be about 100 1MB documents. |
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 |