Skip to content

Commit a77b877

Browse files
[auto-generated] Update plugin files
Check out the commits that caused these changes: moodlehq/moodleapp@bdd6aeb...a1dc1ec
1 parent 0f55021 commit a77b877

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

tests/behat/behat_app.php

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -420,30 +420,42 @@ public function i_press_the_standard_button_in_the_app(string $button) {
420420
/**
421421
* Receives push notifications.
422422
*
423-
* @When /^I receive a push notification in the app for:$/
423+
* @When /^I click a push notification in the app for:$/
424424
* @param TableNode $data Table data
425425
*/
426-
public function i_receive_a_push_notification(TableNode $data) {
426+
public function i_click_a_push_notification(TableNode $data) {
427427
global $DB, $CFG;
428428

429429
$data = (object) $data->getColumnsHash()[0];
430-
$module = $DB->get_record('course_modules', ['idnumber' => $data->module]);
431-
$discussion = $DB->get_record('forum_discussions', ['name' => $data->discussion]);
430+
431+
if (isset($data->module, $data->discussion)) {
432+
$module = $DB->get_record('course_modules', ['idnumber' => $data->module]);
433+
$discussion = $DB->get_record('forum_discussions', ['name' => $data->discussion]);
434+
$data->name = 'posts';
435+
$data->component = 'mod_forum';
436+
}
437+
432438
$notification = json_encode([
433439
'site' => md5($CFG->behat_wwwroot . $data->username),
434-
'courseid' => $discussion->course,
435-
'moodlecomponent' => 'mod_forum',
436-
'name' => 'posts',
440+
'subject' => $data->subject ?? null,
441+
'userfrom' => $data->userfrom ?? null,
442+
'userto' => $data->username ?? null,
443+
'message' => $data->message ?? '',
444+
'title' => $data->title ?? '',
445+
'image' => $data->image ?? null,
446+
'courseid' => $discussion->course ?? null,
447+
'moodlecomponent' => $data->component ?? null,
448+
'name' => $data->name ?? null,
437449
'contexturl' => '',
438450
'notif' => 1,
439-
'customdata' => [
440-
'discussionid' => $discussion->id,
441-
'cmid' => $module->id,
442-
'instance' => $discussion->forum,
443-
],
451+
'customdata' => isset($discussion->id, $module->id, $discussion->forum)
452+
? ['discussionid' => $discussion->id, 'cmid' => $module->id, 'instance' => $discussion->forum]
453+
: null,
454+
'additionalData' => isset($data->subject) || isset($data->userfrom)
455+
? ['foreground' => true, 'notId' => 23, 'notif' => 1] : null,
444456
]);
445457

446-
$this->zone_js("pushNotifications.notificationClicked($notification)", true);
458+
$this->evaluate_script("pushNotifications.notificationClicked($notification)", true);
447459
$this->wait_for_pending_js();
448460
}
449461

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
defined('MOODLE_INTERNAL') || die;
88

9-
$plugin->version = 2022111100;
9+
$plugin->version = 2022111400;
1010
$plugin->requires = 2016052300;
1111
$plugin->maturity = MATURITY_STABLE;
1212
$plugin->release = '4.1.0-dev';

0 commit comments

Comments
 (0)