Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

Unit tests for base entity

Copyright: 2021 David Matamoros <davidmc@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 359 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: base_test  - X-Ref

Unit tests for base entity

test_get_table_alias()   X-Ref
Test entity table alias


test_get_table_alias_invalid()   X-Ref
Test for invalid get table alias


test_set_table_alias()   X-Ref
Test setting table alias


test_set_table_alias_invalid()   X-Ref
Test invalid entity set table alias


test_set_table_aliases()   X-Ref
Test setting multiple table aliases


test_set_table_aliases_invalid()   X-Ref
Test setting multiple table aliases, containing an invalid table


test_set_table_join_alias()   X-Ref
Test setting table join alias


test_has_table_join_alias()   X-Ref
Test that entity doesn't have table join alias by default

{@see test_set_table_join_alias} for assertion where it does

test_set_entity_name()   X-Ref
Test entity name


test_set_entity_title()   X-Ref
Test entity title


test_add_join()   X-Ref
Test adding single join


test_add_joins()   X-Ref
Test adding multiple joins


test_add_duplicate_joins()   X-Ref
Test adding duplicate joins


test_get_column()   X-Ref
Test getting column


test_get_column_invalid()   X-Ref
Test for invalid get column


test_get_columns()   X-Ref
Test getting columns


test_get_filter()   X-Ref
Test getting filter


test_get_filter_invalid()   X-Ref
Test for invalid get filter


test_get_filters()   X-Ref
Test getting filters


test_get_condition()   X-Ref
Test getting condition


test_get_condition_invalid()   X-Ref
Test for invalid get condition


test_get_conditions()   X-Ref
Test getting conditions


Class: base_test_entity  - X-Ref

Simple implementation of the base entity

get_default_table_aliases()   X-Ref
Table aliases

return: array

get_default_entity_title()   X-Ref
Entity title

return: lang_string

initialise()   X-Ref
Initialise entity

return: base