Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Simple db search engine tests.

Copyright: 2016 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 448 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

search_simpledb_engine_testcase:: (12 methods):
  setUp()
  tearDown()
  test_index()
  test_search()
  test_delete()
  test_alloweduserid()
  test_delete_by_id()
  test_deleted_contexts_and_courses()
  assert_raw_index_contents()
  add_mock_search_area()
  update_index()
  requires_manual_index_update()


Class: search_simpledb_engine_testcase  - X-Ref

Simple search engine base unit tests.

setUp()   X-Ref
Initial stuff.

return: void

tearDown()   X-Ref
tearDown

return: void

test_index()   X-Ref
Test indexing process.

return: void

test_search()   X-Ref
Test search filters.

return: void

test_delete()   X-Ref
Test delete function

return: void

test_alloweduserid()   X-Ref
Test user is allowed.

return: void

test_delete_by_id()   X-Ref
No description

test_deleted_contexts_and_courses()   X-Ref
Tries out deleting data for a context or a course.


assert_raw_index_contents(string $searchword, array $expected)   X-Ref
Check the contents of the index.

param: string $searchword Word to match within the content field
param: string[] $expected Array of expected result titles, in alphabetical order

add_mock_search_area()   X-Ref
Adds a mock search area to the search system.


update_index()   X-Ref
Updates mssql fulltext index if necessary.

return: bool

requires_manual_index_update()   X-Ref
Mssql with fulltext support requires manual updates.

return: bool