mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-60680 notifications: Include action buttons information
This commit is contained in:
parent
36fa0ec900
commit
2356454f21
12 changed files with 77 additions and 27 deletions
|
@ -360,6 +360,9 @@ class send_user_notifications extends \core\task\adhoc_task {
|
|||
'discussionid' => $discussion->id,
|
||||
'postid' => $post->id,
|
||||
'notificationiconurl' => $userpicture->get_url($PAGE)->out(false),
|
||||
'actionbuttons' => [
|
||||
'reply' => get_string_manager()->get_string('reply', 'forum', null, $eventdata->userto->lang),
|
||||
],
|
||||
];
|
||||
|
||||
return message_send($eventdata);
|
||||
|
|
|
@ -1530,11 +1530,13 @@ class mod_forum_mail_testcase extends advanced_testcase {
|
|||
$this->send_notifications_and_assert($author, [$post]);
|
||||
$this->send_notifications_and_assert($commenter, [$post]);
|
||||
$messages = $this->messagesink->get_messages();
|
||||
$customdata = json_decode($messages[0]->customdata);
|
||||
$customdata = json_decode($messages[0]->customdata);
|
||||
$this->assertEquals($forum->id, $customdata->instance);
|
||||
$this->assertEquals($forum->cmid, $customdata->cmid);
|
||||
$this->assertEquals($post->id, $customdata->postid);
|
||||
$this->assertEquals($discussion->id, $customdata->discussionid);
|
||||
$this->assertObjectHasAttribute('notificationiconurl', $customdata);
|
||||
$this->assertObjectHasAttribute('actionbuttons', $customdata);
|
||||
$this->assertCount(1, (array) $customdata->actionbuttons);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue