Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311]

(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.