Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401]

(no description)

File Size: 344 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: filter_test  - X-Ref

Unit tests for core_table\local\filter\filter.

test_constructor(array $args, int $jointype, array $values)   X-Ref
Test that the constructor correctly handles a number of conditions.

param: array $args
param: int $jointype
param: array $values

constructor_provider()   X-Ref
Data provider for the constructor providing a range of valid constructor arguments.

return: array

test_constructor_invalid_joins($jointype)   X-Ref
Test that the constructor throws a relevant exception when passed an invalid join.

param: mixed $jointype

constructor_invalid_join_provider()   X-Ref
Data provider for the constructor providing a range of invalid join types to the constructor.

return: array

test_add_filter_value()   X-Ref
Enusre that adding filter values works as expected.


test_set_join_type()   X-Ref
Ensure that it is possibly to set the join type.


test_set_join_type_invalid_low()   X-Ref
Ensure that it is not possible to provide a value out of bounds when setting the join type.


test_set_join_type_invalid_high()   X-Ref
Ensure that it is not possible to provide a value out of bounds when setting the join type.


test_get_name()   X-Ref
Ensure that the name getter is callable.


filter_value_provider()   X-Ref
Data provider for the countable tests.

return: array

test_countable($values, $count)   X-Ref
Ensure that the filter is countable.

param: array   $values List of context IDs
param: int     $count Expected count

test_filter_iteration()   X-Ref
Ensure that the contextlist_base iterates over the set of contexts.


test_filter_current()   X-Ref
Tests for the count function of a filter.