Differences Between: [Versions 310 and 402] [Versions 39 and 402]
The post exporter tests.
Copyright: | 2019 Ryan Wyllie <ryan@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 596 lines (23 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 1 file mod/forum/tests/generator_trait.php |
exporters_post_test:: (4 methods):
test_export_post()
export_post_provider()
test_export_deleted_post()
test_export_post_no_view_capability()
test_capability_manager:: (10 methods):
__construct()
can_view_post()
can_edit_post()
can_delete_post()
can_split_post()
can_reply_to_post()
can_export_post()
can_manually_control_post_read_status()
can_reply_privately_to_post()
can_self_enrol()
Class: exporters_post_test - X-Ref
The post exporter tests.test_export_post($istimed = false, $addtime = 0) X-Ref |
Test the export function returns expected values. param: bool $istimed True if this is a timed post param: int $addtime Seconds to be added to the current time |
export_post_provider() X-Ref |
Data provider for test_export_post(). return: array |
test_export_deleted_post() X-Ref |
Test exporting of a deleted post. |
test_export_post_no_view_capability() X-Ref |
Test exporting of a post the user can't view. |
Class: test_capability_manager - X-Ref
Test implementation of the capability manager.__construct(bool $view = true,bool $edit = true,bool $delete = true,bool $split = true,bool $reply = true,bool $export = true,bool $controlreadstatus = true,bool $canreplyprivatelytopost = true,bool $canenrol = true) X-Ref |
Constructor. param: bool $view Value for can_view_post param: bool $edit Value for can_edit_post param: bool $delete Value for can_delete_post param: bool $split Value for can_split_post param: bool $reply Value for can_reply_to_post param: bool $export Value for can_export_post param: bool $controlreadstatus Value for can_manually_control_post_read_status |
can_view_post(\stdClass $user, discussion_entity $discussion, post_entity $post) X-Ref |
Override can_view_post param: \stdClass $user The user param: discussion_entity $discussion The discussion param: post_entity $post The post return: bool |
can_edit_post(\stdClass $user, discussion_entity $discussion, post_entity $post) X-Ref |
Override can_edit_post param: \stdClass $user The user param: discussion_entity $discussion The discussion param: post_entity $post The post return: bool |
can_delete_post(\stdClass $user, discussion_entity $discussion, post_entity $post,bool $hasreplies = false) X-Ref |
Override can_delete_post param: \stdClass $user The user param: discussion_entity $discussion The discussion param: post_entity $post The post param: bool $hasreplies return: bool |
can_split_post(\stdClass $user, discussion_entity $discussion, post_entity $post) X-Ref |
Override can_split_post param: \stdClass $user The user param: discussion_entity $discussion The discussion param: post_entity $post The post return: bool |
can_reply_to_post(\stdClass $user, discussion_entity $discussion, post_entity $post) X-Ref |
Override can_reply_to_post param: \stdClass $user The user param: discussion_entity $discussion The discussion param: post_entity $post The post return: bool |
can_export_post(\stdClass $user, post_entity $post) X-Ref |
Override can_export_post param: \stdClass $user The user param: post_entity $post The post return: bool |
can_manually_control_post_read_status(\stdClass $user) X-Ref |
Override can_manually_control_post_read_status param: \stdClass $user The user return: bool |
can_reply_privately_to_post(\stdClass $user, post_entity $post) X-Ref |
Override can_reply_privately_to_post param: \stdClass $user param: post_entity $post return: bool |
can_self_enrol(\stdClass $user) X-Ref |
Override can_self_enrol param: \stdClass $user return: bool |