Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 310 and 402] [Versions 39 and 402]

Fixture for mocking callbacks used in \core_course_category

Copyright: 2020 Ruslan Kabalin
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 186 lines (6 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: mock_hooks  - X-Ref

Class mock_hooks

set_calling_arguments($callingarguments)   X-Ref
Set calling arguments.

This is supposed to be used in the callbacks to store arguments passed to callback.

param: array $callingarguments

get_calling_arguments()   X-Ref
Get calling arguments.

This is supposed to be used in the test to verify arguments passed to callback.
This method also reset stored calling arguments.

return: array $callingarguments

get_can_course_category_delete_return()   X-Ref
Get can_course_category_delete callback return.

return: bool

set_can_course_category_delete_return(bool $return)   X-Ref
Sets can_course_category_delete callback return.

param: bool $return

get_can_course_category_delete_move_return()   X-Ref
Get can_course_category_delete_move callback return.

return: bool

set_can_course_category_delete_move_return(bool $return)   X-Ref
Sets can_course_category_delete_move callback return.

param: bool $return

get_get_course_category_contents_return()   X-Ref
Get get_course_category_contents callback return.

return: string

set_get_course_category_contents_return(string $return)   X-Ref
Sets get_course_category_contents callback return.

param: string $return

tool_unittest_pre_course_category_delete(object $category)   X-Ref
Test pre_course_category_delete callback.

param: object $category

tool_unittest_pre_course_category_delete_move(core_course_category $category, core_course_category $newcategory)   X-Ref
Test pre_course_category_delete_move callback.

param: core_course_category $category
param: core_course_category $newcategory

tool_unittest_can_course_category_delete(core_course_category $category)   X-Ref
Test can_course_category_delete callback.

param: core_course_category $category
return: bool

tool_unittest_can_course_category_delete_move(core_course_category $category, core_course_category $newcategory)   X-Ref
Test can_course_category_delete_move callback.

param: core_course_category $category
param: core_course_category $newcategory
return: bool

tool_unittest_get_course_category_contents(core_course_category $category)   X-Ref
Test get_course_category_contents callback.

param: core_course_category $category
return: string