[ Index ]

PHP Cross Reference of Moodle 310

title

Body

[close]

/privacy/tests/ -> contextlist_base_test.php (summary)

Unit Tests for the abstract contextlist Class

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 305 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

contextlist_base_test:: (9 methods):
  test_get_contextids()
  get_contextids_provider()
  test_get_contexts()
  test_countable()
  test_context_iteration()
  test_current_context_one_context()
  test_current_context_two_contexts()
  test_get_contexts_all_deleted()
  test_get_contexts_one_deleted()

test_contextlist_base:: (1 method):
  set_contextids()


Class: contextlist_base_test  - X-Ref

Tests for the \core_privacy API's contextlist base functionality.

test_get_contextids($input, $expected, $count)   X-Ref
Ensure that get_contextids returns the list of unique contextids.

param: array   $input List of context IDs
param: array   $expected list of contextids
param: int     $count Expected count

get_contextids_provider()   X-Ref
Provider for the list of contextids.

return: array

test_get_contexts()   X-Ref
Ensure that get_contexts returns the correct list of contexts.


test_countable($input, $expected, $count)   X-Ref
Ensure that the contextlist_base is countable.

param: array   $input List of context IDs
param: array   $expected list of contextids
param: int     $count Expected count

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


test_current_context_one_context()   X-Ref
Test that deleting a context results in current returning nothing.


test_current_context_two_contexts()   X-Ref
Test that deleting a context results in the next record being returned.


test_get_contexts_all_deleted()   X-Ref
Test that if there are no non-deleted contexts that nothing is returned.


test_get_contexts_one_deleted()   X-Ref
Test that get_contexts() returns only active contexts.


Class: test_contextlist_base  - X-Ref

A test class extending the contextlist_base allowing setting of the
contextids.

set_contextids(array $contextids)   X-Ref
Set the contextids for the test class.

param: int[]   $contexids  The list of contextids to use.



Generated: Wed Jan 22 11:59:49 2025 Cross-referenced by PHPXref 0.7.1