Skip to content

Commit

Permalink
[auto-generated] Update plugin files
Browse files Browse the repository at this point in the history
Check out the commits that caused these changes: moodlehq/moodleapp@bdd6aeb...a1dc1ec
  • Loading branch information
github-actions[bot] committed Nov 14, 2022
1 parent 0f55021 commit a77b877
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
38 changes: 25 additions & 13 deletions tests/behat/behat_app.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,30 +420,42 @@ public function i_press_the_standard_button_in_the_app(string $button) {
/**
* Receives push notifications.
*
* @When /^I receive a push notification in the app for:$/
* @When /^I click a push notification in the app for:$/
* @param TableNode $data Table data
*/
public function i_receive_a_push_notification(TableNode $data) {
public function i_click_a_push_notification(TableNode $data) {
global $DB, $CFG;

$data = (object) $data->getColumnsHash()[0];
$module = $DB->get_record('course_modules', ['idnumber' => $data->module]);
$discussion = $DB->get_record('forum_discussions', ['name' => $data->discussion]);

if (isset($data->module, $data->discussion)) {
$module = $DB->get_record('course_modules', ['idnumber' => $data->module]);
$discussion = $DB->get_record('forum_discussions', ['name' => $data->discussion]);
$data->name = 'posts';
$data->component = 'mod_forum';
}

$notification = json_encode([
'site' => md5($CFG->behat_wwwroot . $data->username),
'courseid' => $discussion->course,
'moodlecomponent' => 'mod_forum',
'name' => 'posts',
'subject' => $data->subject ?? null,
'userfrom' => $data->userfrom ?? null,
'userto' => $data->username ?? null,
'message' => $data->message ?? '',
'title' => $data->title ?? '',
'image' => $data->image ?? null,
'courseid' => $discussion->course ?? null,
'moodlecomponent' => $data->component ?? null,
'name' => $data->name ?? null,
'contexturl' => '',
'notif' => 1,
'customdata' => [
'discussionid' => $discussion->id,
'cmid' => $module->id,
'instance' => $discussion->forum,
],
'customdata' => isset($discussion->id, $module->id, $discussion->forum)
? ['discussionid' => $discussion->id, 'cmid' => $module->id, 'instance' => $discussion->forum]
: null,
'additionalData' => isset($data->subject) || isset($data->userfrom)
? ['foreground' => true, 'notId' => 23, 'notif' => 1] : null,
]);

$this->zone_js("pushNotifications.notificationClicked($notification)", true);
$this->evaluate_script("pushNotifications.notificationClicked($notification)", true);
$this->wait_for_pending_js();
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2022111100;
$plugin->version = 2022111400;
$plugin->requires = 2016052300;
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '4.1.0-dev';
Expand Down

0 comments on commit a77b877

Please sign in to comment.